RaceCond.hlsl 389 B

123456789101112131415
  1. // RUN: %dxc -E main -T cs_6_0 %s | FileCheck %s
  2. // CHECK: Race condition writing to shared memory detected, consider making this write conditional
  3. RWBuffer< int > g_Intensities : register(u1);
  4. groupshared int sharedData;
  5. [ numthreads( 64, 2, 2 ) ]
  6. void main( uint GI : SV_GroupIndex)
  7. {
  8. sharedData = GI;
  9. InterlockedAdd(sharedData, g_Intensities[GI]);
  10. g_Intensities[GI] = sharedData;
  11. }