ConsumeStructuredBuffer.hlsl 531 B

123456789101112131415161718192021222324
  1. // RUN: %fxc /Tps_5_0 %s /Fo %t.fxc
  2. // RUN: %dxbc2dxil %t.fxc /emit-llvm | %FileCheck %s -check-prefix=DXIL
  3. // DXIL: !{i32 0, %dx.types.i8x36 addrspace(1)* undef, !"U0", i32 0, i32 5, i32 1, i32 12, i1 false, i1 true
  4. struct X {
  5. float4 a;
  6. float3 b;
  7. float2 c;
  8. };
  9. ConsumeStructuredBuffer<X> buf : register(u5);
  10. #ifdef DX12
  11. #define RS "DescriptorTable(" \
  12. "UAV(u5), "\
  13. "visibility=SHADER_VISIBILITY_ALL)"
  14. [RootSignature( RS )]
  15. #endif
  16. float4 main(int i : A) : SV_TARGET
  17. {
  18. return buf.Consume().a;
  19. }