Original Post
Hello,
I'm playing around with compute shaders, so for my first more serious CS I decided to implement a simple blur shader.
Right now I finished the horizontal blur pass and it worked, until I switch on optimization levels 2 or 3 (D3D10_SHADER_OPTIMIZATION_LEVEL2, _3).
It works for D3D10_SHADER_SKIP_OPTIMIZATION and D3D10_SHADER_OPTIMIZATION_LEVEL1 flags.
Here is the error:
"race condition writing to shared memory detected, consider making this write conditional"
My blur looks "ok" for the horizontal pass, there aren't any artifacts that you get if you screw up your thread/group index calculations
I'm confused about this error, as if the blur algorith incorrectly indexes the shared variable only in the release version with optimizations enabled.
Here is a rough outline of how I do the blur:
Any suggestion what could be causing this error on the higher optimization levels??
I'm playing around with compute shaders, so for my first more serious CS I decided to implement a simple blur shader.
Right now I finished the horizontal blur pass and it worked, until I switch on optimization levels 2 or 3 (D3D10_SHADER_OPTIMIZATION_LEVEL2, _3).
It works for D3D10_SHADER_SKIP_OPTIMIZATION and D3D10_SHADER_OPTIMIZATION_LEVEL1 flags.
Here is the error:
"race condition writing to shared memory detected, consider making this write conditional"
My blur looks "ok" for the horizontal pass, there aren't any artifacts that you get if you screw up your thread/group index calculations
I'm confused about this error, as if the blur algorith incorrectly indexes the shared variable only in the release version with optimizations enabled.
Here is a rough outline of how I do the blur:
groupshared float4 gsPixels[32*2*2]; // The error points to this line
[numthreads(32,2,1)]
void CSMAIN(...)
{
// Compute some indexes and texcoords based on the CSMAIN thread/group id input parameters
// Nothing is read/written from any resource at this point
....
// Now I read some colors from the fullscreen texture and I store
// them into the gsPixels variable.
// Now I wait for all threads to finish writing to the group shared variable
GroupMemoryBarrierWithGroupSync();
// And now I read the values from the gsPixels variable and do the
// actual blur and write the result to the UAV
}
Any suggestion what could be causing this error on the higher optimization levels??