Conversation
|
I've almost gotten atomics work in spv-in, but then stumbled upon the fact that generating new types ruins the guarantee that IR has that a dependent type always shows up before the parent... So I'm going to drop spv-in from this PR and leave it for a follow-up. #version 310 es
layout(local_size_x = 64) in;
// Persistent LIFO structure with a count of elements
layout(std430, binding = 0) restrict buffer SMyBuffer
{
int count;
float data[];
} MyBuffer;
void main()
{
for (uint i = gl_GlobalInvocationID.x; i < 20U; i += gl_WorkGroupSize.x)
{
int dataIndex = atomicAdd(MyBuffer.count, 1);
MyBuffer.data[dataIndex] = float(i);
}
} |
a4f86ac to
74950e5
Compare
0904243 to
2b551bd
Compare
jimblandy
left a comment
There was a problem hiding this comment.
I'm sorry - I still have a ways to go with this. But here are my comments so far - let me know what you think.
|
I think this review is amazing, thank you! |
jimblandy
left a comment
There was a problem hiding this comment.
Wow, this is a great start for the atomics - so glad to see this happening.
I found a few issues, but over all things look great. I don't think I need to see this again after you've addressed these comments, so I'm just going to approve it.
Fixes #865
Some frontend and backend work is still due, but it's mergeable.
More specifically, here are the current limitations:
HLSL backend (missing)"access.wgsl" test disabled for HLSL backend, hopefully temporaryatomicCompareExchangeWeakisn't implemented on anything but WGSL - atomicCompareExchangeWeak is not idiomatic gpuweb/gpuweb#2021