nested_struct_arg.hlsl 469 B

123456789101112131415161718192021222324
  1. // RUN: %dxc -Zi -E main -Od -T ps_6_0 %s | FileCheck %s
  2. // Make sure all elements of the struct in an arg (even when there are nested
  3. // structs) are at distinct offsets.
  4. // Exclude quoted source file (see readme)
  5. // CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
  6. // CHECK-DAG: DW_OP_bit_piece
  7. struct K_ARG {
  8. float foo : KFOO;
  9. };
  10. struct S_ARG {
  11. float foo : FOO;
  12. K_ARG bar;
  13. float baz : BAZ;
  14. };
  15. float main(S_ARG s) : SV_Target {
  16. return s.bar.foo + s.foo + s.baz;
  17. }