selectObj3.hlsl 648 B

123456789101112131415161718192021222324252627
  1. // RUN: %dxc -E main -T cs_6_0 %s | FileCheck %s
  2. // CHECK: local resource not guaranteed to map to unique global resource
  3. RWStructuredBuffer<float2x2> oA;
  4. RWStructuredBuffer<float2x2> oB;
  5. RWStructuredBuffer<float2x2> oC;
  6. StructuredBuffer<float2x2> iA;
  7. StructuredBuffer<float2x2> iB;
  8. uint s;
  9. [numthreads(8,8,1)]
  10. void main( uint2 tid : SV_DispatchThreadID, uint2 gid : SV_GroupID, uint2 gtid : SV_GroupThreadID, uint gidx : SV_GroupIndex )
  11. {
  12. RWStructuredBuffer<float2x2> o = s>7? oA: oB;
  13. StructuredBuffer<float2x2> input = s>7? iA : iB;
  14. o = s>9? o : oC;
  15. for (uint i=0;i<4;i++) {
  16. input = i%2==0 ? input : iB;
  17. o[gid.x] = input [gid.x];
  18. }
  19. }