2
0

AppendStructuredBuffer.hlsl 565 B

123456789101112131415161718192021222324252627
  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.i8x28 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. };
  8. AppendStructuredBuffer<X> buf : register(u5);
  9. #ifdef DX12
  10. #define RS "DescriptorTable(" \
  11. "UAV(u5), "\
  12. "visibility=SHADER_VISIBILITY_ALL)"
  13. [RootSignature( RS )]
  14. #endif
  15. float4 main(float i : A) : SV_TARGET
  16. {
  17. X x = (X)0;
  18. x.a = i;
  19. x.b = i + 1;
  20. buf.Append(x);
  21. return x.a;
  22. }