method.append-structured-buffer.get-dimensions.hlsl 375 B

123456789101112131415161718
  1. // Run: %dxc -T vs_6_0 -E main -fvk-use-gl-layout
  2. struct S {
  3. float a;
  4. float3 b;
  5. float2x3 c;
  6. };
  7. AppendStructuredBuffer<S> buffer;
  8. void main() {
  9. uint numStructs, stride;
  10. // CHECK: [[len:%\d+]] = OpArrayLength %uint %buffer 0
  11. // CHECK-NEXT: OpStore %numStructs [[len]]
  12. // CHECK-NEXT: OpStore %stride %uint_64
  13. buffer.GetDimensions(numStructs, stride);
  14. }