You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Writing to different components of a vector from different invocations #2112
This code is producing non-deterministic results in Chrome for both Metal and D3D.
The MSL spec says:
When assigning a swizzled value to a variable, the GPU may need to read the existing value,
modify it, and write the result back. [...]. If two threads write to different components of the vector at the same time, the result is undefined.
I haven't found similar text in the HLSL docs yet.
We should add language to the WGSL specification to surface this UB.
The simplest solution is probably to say something along the lines of "accessing a vector component affects all the memory locations associated with vector, not just the component".
Activity
alan-baker commentedon Sep 15, 2021
The simplest solution is probably to say something along the lines of "accessing a vector component affects all the memory locations associated with vector, not just the component".
Clarify memory locations accessed when writing a vector component
Clarify memory locations accessed when writing a vector component (#2152