unbounded-arrays2.azsl 1.2 KB

123456789101112131415161718192021222324252627282930
  1. // Makes sure unbounded arrays are supported across all register classes t,u,s,b,
  2. // makes sure it's ok that the unbounded array is actually the last one of its kind.
  3. ShaderResourceGroupSemantic slot1
  4. {
  5. FrequencyId = 1;
  6. };
  7. struct MyStruct
  8. {
  9. float3 m_a;
  10. float3 m_b;
  11. };
  12. ShaderResourceGroup SRG1 : slot1
  13. {
  14. float3 m_data; // Triggers the creation of the SRG1 implicit constant buffer.
  15. Texture2D<float4> m_texSRVa; // Takes t0
  16. Texture2D<float4> m_texSRVb; // Takes t1
  17. Texture2D<float4> m_texSRVc[]; // Takes t2+
  18. RWTexture2D<float4> m_texUAVa; // Takes u0
  19. RWTexture2D<float4> m_texUAVb; // Takes u1
  20. RWTexture2D<float4> m_texUAVc[]; // Takes u2+
  21. Sampler m_samplera; // Takes s0
  22. Sampler m_samplerb; // Takes s1
  23. Sampler m_samplerc[]; // Takes s2+
  24. ConstantBuffer<MyStruct> m_structArraya; // Takes b1 register (b0 taken by SRG1 implicit constant buffer, due to m_data).
  25. ConstantBuffer<MyStruct> m_structArrayb; // Takes b2
  26. ConstantBuffer<MyStruct> m_structArrayc[]; // Takes b3+
  27. };