class.hlsl 387 B

1234567891011121314151617181920212223242526
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // Make sure N n2[2] lowered into float [2]
  3. // CHECK:[2 x float]
  4. struct N {
  5. float n;
  6. };
  7. class X {
  8. float2x2 ma[2];
  9. N n2[2];
  10. row_major float3x3 m;
  11. N test_inout(float idx) {
  12. return n2[idx];
  13. }
  14. };
  15. X x0;
  16. float4 main(float4 a : A, float4 b:B) : SV_TARGET
  17. {
  18. X x = x0;
  19. x.n2[0].n = 1;
  20. return x.test_inout(a.x).n;
  21. }