cbuffer_copy3.hlsl 337 B

12345678910111213141516171819202122232425262728
  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 S {
  5. float s;
  6. };
  7. cbuffer T
  8. {
  9. S s;
  10. float4 a[1];
  11. float4 b[2];
  12. }
  13. static const struct
  14. {
  15. S s;
  16. float4 a[1];
  17. float4 b[2];
  18. } ST = { s, a, b};
  19. uint i;
  20. float4 main() : SV_Target
  21. {
  22. return ST.a[i] + ST.b[i];
  23. }