@@ -25,6 +25,7 @@ enum RootParameterIndex
2525{
2626 ConstantBuffer,
2727 TextureSRV,
28+ TextureSRV_2,
2829 Count
2930};
3031
@@ -38,6 +39,7 @@ void FullScreenQuad::Initialize(_In_ ID3D12Device* d3dDevice)
3839 D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
3940
4041 CD3DX12_DESCRIPTOR_RANGE textureSRVs (D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1 , 0 );
42+ CD3DX12_DESCRIPTOR_RANGE textureSRVs_2 (D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1 , 1 );
4143
4244 CD3DX12_STATIC_SAMPLER_DESC sampler (
4345 0 , // register
@@ -56,6 +58,7 @@ void FullScreenQuad::Initialize(_In_ ID3D12Device* d3dDevice)
5658 CD3DX12_ROOT_PARAMETER rootParameters[static_cast <uint32_t >(RootParameterIndex::Count)] = {};
5759 rootParameters[RootParameterIndex::ConstantBuffer].InitAsConstantBufferView (0 , 0 , D3D12_SHADER_VISIBILITY_PIXEL);
5860 rootParameters[RootParameterIndex::TextureSRV].InitAsDescriptorTable (1 , &textureSRVs, D3D12_SHADER_VISIBILITY_PIXEL);
61+ rootParameters[RootParameterIndex::TextureSRV_2].InitAsDescriptorTable (1 , &textureSRVs_2, D3D12_SHADER_VISIBILITY_PIXEL);
5962
6063 CD3DX12_ROOT_SIGNATURE_DESC rootSignatureDesc;
6164 rootSignatureDesc.Init (_countof (rootParameters), rootParameters, 1 , &sampler, rootSignatureFlags);
@@ -77,6 +80,24 @@ void FullScreenQuad::Draw(
7780 d3dCommandList->SetGraphicsRootSignature (m_d3dRootSignature.Get ());
7881 d3dCommandList->SetGraphicsRootConstantBufferView (RootParameterIndex::ConstantBuffer, constantBuffer);
7982 d3dCommandList->SetGraphicsRootDescriptorTable (RootParameterIndex::TextureSRV, texture);
83+ d3dCommandList->SetGraphicsRootDescriptorTable (RootParameterIndex::TextureSRV_2, texture);
84+ d3dCommandList->SetPipelineState (d3dPSO);
85+ d3dCommandList->IASetPrimitiveTopology (D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
86+ d3dCommandList->DrawInstanced (3 , 1 , 0 , 0 );
87+ }
88+
89+ _Use_decl_annotations_
90+ void FullScreenQuad::Draw (
91+ ID3D12GraphicsCommandList* d3dCommandList,
92+ ID3D12PipelineState* d3dPSO,
93+ D3D12_GPU_DESCRIPTOR_HANDLE texture,
94+ D3D12_GPU_DESCRIPTOR_HANDLE texture2,
95+ D3D12_GPU_VIRTUAL_ADDRESS constantBuffer)
96+ {
97+ d3dCommandList->SetGraphicsRootSignature (m_d3dRootSignature.Get ());
98+ d3dCommandList->SetGraphicsRootConstantBufferView (RootParameterIndex::ConstantBuffer, constantBuffer);
99+ d3dCommandList->SetGraphicsRootDescriptorTable (RootParameterIndex::TextureSRV, texture);
100+ d3dCommandList->SetGraphicsRootDescriptorTable (RootParameterIndex::TextureSRV_2, texture2);
80101 d3dCommandList->SetPipelineState (d3dPSO);
81102 d3dCommandList->IASetPrimitiveTopology (D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
82103 d3dCommandList->DrawInstanced (3 , 1 , 0 , 0 );
0 commit comments