struct_piece.hlsl 446 B

12345678910111213141516171819202122
  1. // RUN: %dxc -Od -Zi -E main -T ps_6_0 %s | FileCheck %s
  2. // Make sure the bit pieces have the offset in bits
  3. // Exclude quoted source file (see readme)
  4. // CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
  5. // CHECK-DAG: !DIExpression(DW_OP_bit_piece, 0, 32)
  6. // CHECK-DAG: !DIExpression(DW_OP_bit_piece, 32, 32)
  7. struct S {
  8. float foo;
  9. float bar;
  10. };
  11. float main(float a : A) : SV_Target {
  12. S s;
  13. s.foo = a * a;
  14. s.bar = a + a;
  15. return s.foo + s.bar;
  16. }