I have a compute shader where I have a RWStructuredBuffer sized to the same dimensions as a RWTexture2D. I want to perform a bunch of writes to the RWStructuredBuffer, then synchronize, and then copy the data to the RWTexture2D. All buffer accesses are within the same thread group..
When I do this, and display the texture with a quad, I see a bunch of flickering black regions through the texture. They pretty clearly correspond to the thread groups. This only happens with data written to and then read from the RWStructuredBuffer: I passed in a time value 'T', set the red channel of the texture to frac(T), and set the green/blue channels of the texture to the data read from the RWStructuredBuffer. Doing that, I see a smooth transition of red across all thread groups, but the green/blue are still flickering. I put a GroupMemoryBarrierWithGroupSync() (and all the various permutations of memory barriers) in between the writes to the RWStructuredBuffer and then the read from it. I have made sure I have resource barriers for transitions in the command list from UAV to Pixel Shader Resource. There's nothing in the output from the Debug Layer indicating a problem.
What am I missing?