selectObj5.hlsl 638 B

123456789101112131415161718192021222324
  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. // CHECK: local resource not guaranteed to map to unique global resource
  4. RWStructuredBuffer<float2x2> o1;
  5. RWStructuredBuffer<float2x2> o2;
  6. StructuredBuffer<float2x2> i1;
  7. StructuredBuffer<float2x2> i2;
  8. uint s;
  9. void run(uint id) {
  10. RWStructuredBuffer<float2x2> ot = s > 8 ? o2:o1;
  11. StructuredBuffer<float2x2> it = s < 7 ? i1:i2;
  12. ot[id] = it[id];
  13. }
  14. [numthreads(8,8,1)]
  15. void main( uint2 tid : SV_DispatchThreadID, uint2 gid : SV_GroupID, uint2 gtid : SV_GroupThreadID, uint gidx : SV_GroupIndex )
  16. {
  17. run(tid.x);
  18. }