vk.layout.cbuffer.nested.empty.std140.hlsl 820 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Run: %dxc -T vs_6_0 -E main
  2. // CHECK: OpMemberDecorate %OuterStruct 0 Offset 0
  3. // CHECK: OpMemberDecorate %OuterStruct 1 Offset 0
  4. // CHECK: OpMemberDecorate %type_Params_cbuffer 0 Offset 0
  5. // CHECK: %InnerStruct0 = OpTypeStruct
  6. // CHECK: %OuterStruct = OpTypeStruct %InnerStruct0 %InnerStruct0
  7. // CHECK: %type_Params_cbuffer = OpTypeStruct %OuterStruct
  8. struct InnerStruct0 {};
  9. struct InnerStruct1 {};
  10. struct OuterStruct
  11. {
  12. InnerStruct0 s0;
  13. InnerStruct1 s1;
  14. };
  15. struct MyParams
  16. {
  17. OuterStruct constants;
  18. };
  19. cbuffer Params_cbuffer : register(b0)
  20. {
  21. OuterStruct constants;
  22. };
  23. MyParams CreateParams()
  24. {
  25. MyParams i;
  26. i.constants = constants;
  27. return i;
  28. }
  29. static const MyParams params_vars = CreateParams();
  30. float4 main(float4 pos : POSITION) : SV_POSITION
  31. {
  32. return float4(0, 0, 0, 0);
  33. }