NonUniform-ConstantBuffer.hlsl 435 B

123456789101112131415161718
  1. // RUN: %dxc -E main -T cs_6_0 %s | FileCheck %s
  2. // Expect non-uniform resource index (i1 true):
  3. // CHECK: call %dx.types.Handle @dx.op.createHandle(i32 57, i8 2, i32 0, i32 {{.*}}, i1 true)
  4. struct CBType
  5. {
  6. float cbvals[4];
  7. };
  8. ConstantBuffer<CBType> CBs[100] : register(b0);
  9. RWBuffer<uint> Output;
  10. [numthreads(4,1,1)]
  11. void main(uint index : SV_GroupThreadID)
  12. {
  13. Output[index] = CBs[NonUniformResourceIndex(index)].cbvals[0];
  14. }