array_piece.hlsl 713 B

123456789101112131415161718192021222324252627282930313233
  1. // RUN: %dxc -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. // CHECK-DAG: !DIExpression(DW_OP_bit_piece, 64, 32)
  8. // CHECK-DAG: !DIExpression(DW_OP_bit_piece, 96, 32)
  9. float main(float a : A, float b : B, float c : C, float d : D, float e : E) : SV_Target {
  10. float s[4] = {
  11. a+b,
  12. b+c,
  13. c+d,
  14. d+e,
  15. };
  16. [unroll]
  17. for (int i = 0; i < 4; i++)
  18. s[i] *= s[i];
  19. float result = 0;
  20. [unroll]
  21. for (int i = 0; i < 4; i++)
  22. result += s[i];
  23. return result;
  24. }