cbuffer_copy4.hlsl 316 B

1234567891011121314151617181920212223242526272829
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // Make sure no alloca to copy.
  3. // CHECK-NOT: alloca
  4. struct M {
  5. float4x4 m;
  6. };
  7. cbuffer T
  8. {
  9. M a[2];
  10. float4 b[2];
  11. }
  12. struct ST
  13. {
  14. M a[2];
  15. float4 b[2];
  16. };
  17. uint i;
  18. float4 main() : SV_Target
  19. {
  20. ST st;
  21. st.a = a;
  22. st.b = b;
  23. return mul(st.a[i].m, st.b[i]);
  24. }