diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-24 19:15:28 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-24 19:15:28 +0000 |
| commit | 82198dc5b8284382d27d5f6776fb2531b805a83e (patch) | |
| tree | 6734be86fdf30c87a7d244e13133bc2bcf7452d2 /Tests/TestApp/src/TestDrawCommands.cpp | |
| parent | Updated core (fixed state transiton issue in D3D11) (diff) | |
| download | DiligentEngine-82198dc5b8284382d27d5f6776fb2531b805a83e.tar.gz DiligentEngine-82198dc5b8284382d27d5f6776fb2531b805a83e.zip | |
Added explicit control over resource transitions in draw command
Added explicit static resource binding initialization in SRB objects
Diffstat (limited to 'Tests/TestApp/src/TestDrawCommands.cpp')
| -rw-r--r-- | Tests/TestApp/src/TestDrawCommands.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Tests/TestApp/src/TestDrawCommands.cpp b/Tests/TestApp/src/TestDrawCommands.cpp index 1c0a5ea..cdd90d6 100644 --- a/Tests/TestApp/src/TestDrawCommands.cpp +++ b/Tests/TestApp/src/TestDrawCommands.cpp @@ -255,12 +255,14 @@ void TestDrawCommands::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceCont pVS->BindResources(m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED); pVSInst->BindResources(m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED | BIND_SHADER_RESOURCES_UPDATE_STATIC); pPS->BindResources(m_pResMapping, BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED | BIND_SHADER_RESOURCES_UPDATE_ALL); + m_pPSO->CreateShaderResourceBinding(&m_pSRB, true); + m_pPSOInst->CreateShaderResourceBinding(&m_pSRBInst, true); } void TestDrawCommands::Draw() { m_pDeviceContext->SetPipelineState(m_pPSO); - m_pDeviceContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); + m_pDeviceContext->CommitShaderResources(m_pSRB, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); IBuffer *pBuffs[2] = {m_pVertexBuff, m_pInstanceData}; Uint32 Strides[] = {sizeof(float)*6, sizeof(float)*2}; @@ -318,7 +320,7 @@ void TestDrawCommands::Draw() // 8,9: test strides Strides[0] *= 2; m_pDeviceContext->SetPipelineState(m_pPSO_2xStride); - m_pDeviceContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); + m_pDeviceContext->CommitShaderResources(m_pSRB, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); m_pDeviceContext->SetVertexBuffers(0, 1, pBuffs, Offsets, SET_VERTEX_BUFFERS_FLAG_RESET); { DrawAttribs DrawAttrs; @@ -328,7 +330,7 @@ void TestDrawCommands::Draw() } Strides[0] /= 2; m_pDeviceContext->SetPipelineState(m_pPSO); - m_pDeviceContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); + m_pDeviceContext->CommitShaderResources(m_pSRB, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); NumTestTrianglesInRow[0] = 12; @@ -397,8 +399,8 @@ void TestDrawCommands::Draw() // 4TH ROW: Instanced non-indexed rendering (glDrawArraysInstanced/DrawInstanced) m_pDeviceContext->SetPipelineState(m_pPSOInst); - m_pDeviceContext->TransitionShaderResources(m_pPSOInst, nullptr); - m_pDeviceContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES); + m_pDeviceContext->TransitionShaderResources(m_pPSOInst, m_pSRBInst); + m_pDeviceContext->CommitShaderResources(m_pSRBInst, COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES); Offsets[0] = 3*16*3 * 6*sizeof(float); m_pDeviceContext->SetVertexBuffers(0, 2, pBuffs, Offsets, SET_VERTEX_BUFFERS_FLAG_RESET); @@ -889,7 +891,7 @@ void TestDrawCommands::Draw() m_pDeviceContext->SetVertexBuffers(0, 1, pBuffs, Offsets, SET_VERTEX_BUFFERS_FLAG_RESET); m_pDeviceContext->SetPipelineState(m_pPSO); - m_pDeviceContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); + m_pDeviceContext->CommitShaderResources(m_pSRB, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); { DrawAttribs DrawAttrs; |
