structInBuffer3.hlsl 501 B

12345678910111213141516171819202122232425
  1. // RUN: %dxc -E main -T cs_6_0 %s | FileCheck %s
  2. // CHECK: all template type components must have the same type
  3. struct Foo {
  4. int a;
  5. int b;
  6. float c;
  7. int d;
  8. };
  9. Buffer<Foo> inputs : register(t1);
  10. RWBuffer< int > g_Intensities : register(u1);
  11. groupshared Foo sharedData;
  12. [ numthreads( 64, 2, 2 ) ]
  13. void main( uint GI : SV_GroupIndex)
  14. {
  15. if(GI==0)
  16. sharedData = inputs[GI];
  17. int rtn;
  18. InterlockedAdd(sharedData.d, g_Intensities[GI], rtn);
  19. g_Intensities[GI] = rtn + sharedData.d;
  20. }