I have code like this:
groupshared uint tempData[ElementsCount];
[numthreads(ElementsCount/2, 1, 1)]
void CSMain(uint3 gID: SV_GroupID, uint3 gtID: SV_GroupThreadID)
{
tempData[gtID.x] = 0;
}
And it works fine. Now I change it to this:
void MyFunc(inout uint3 gtID: SV_GroupThreadID, inout uint inputData[ElementsCount])
{
inputData[gtID.x] = 0;
}
groupshared uint tempData[ElementsCount];
[numthreads(ElementsCount/2, 1, 1)]
void CSMain(uint3 gID: SV_GroupID, uint3 gtID: SV_GroupThreadID)
{
MyFunc(gtID, tempData);
}
and I get "error X3695: race condition writing to shared memory detected, consider making this write conditional.". Any way to go around this?