12345678910111213141516171819202122232425262728293031323334353637383940 |
- // Makes sure unbounded arrays are supported across all register classes t,u,s,b.
- // This example demonstrates each SRG having a unique register space, allowing another implicit ConstantBuffer.
- ShaderResourceGroupSemantic slot1
- {
- FrequencyId = 1;
- };
- ShaderResourceGroupSemantic slot2
- {
- FrequencyId = 2;
- };
- struct MyStruct
- {
- float3 m_a;
- float3 m_b;
- };
- ShaderResourceGroup SRG1 : slot1
- {
- Texture2D<float4> m_texSRVa; // Takes t0
- Texture2D<float4> m_texSRVb; // Takes t1
- Texture2D<float4> m_texSRVc[]; // Takes t2+
- RWTexture2D<float4> m_texUAVa; // Takes u0
- RWTexture2D<float4> m_texUAVb; // Takes u1
- RWTexture2D<float4> m_texUAVc[]; // Takes u2+
- Sampler m_samplera; // Takes s0
- Sampler m_samplerb; // Takes s1
- Sampler m_samplerc[]; // Takes s2+
- ConstantBuffer<MyStruct> m_structArraya; // Takes b0
- ConstantBuffer<MyStruct> m_structArrayb; // Takes b1
- ConstantBuffer<MyStruct> m_structArrayc[]; // Takes b2+
- };
- ShaderResourceGroup SRG2 : slot2
- {
- // Having unique register spaces for each SRG allows this to SRG's implicit constant buffer to use space1 while SRG1 uses space0.
- int m_data;
- }
|