From 82198dc5b8284382d27d5f6776fb2531b805a83e Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 24 Nov 2018 11:15:28 -0800 Subject: Added explicit control over resource transitions in draw command Added explicit static resource binding initialization in SRB objects --- Tests/TestApp/src/TestTexturing.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Tests/TestApp/src/TestTexturing.cpp') diff --git a/Tests/TestApp/src/TestTexturing.cpp b/Tests/TestApp/src/TestTexturing.cpp index 23292c6..4bb53c6 100644 --- a/Tests/TestApp/src/TestTexturing.cpp +++ b/Tests/TestApp/src/TestTexturing.cpp @@ -268,10 +268,12 @@ void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext PSODesc.GraphicsPipeline.InputLayout.LayoutElements = Elems; PSODesc.GraphicsPipeline.InputLayout.NumElements = _countof( Elems ); pDevice->CreatePipelineState(PSODesc, &m_pPSO); - + pVS->BindResources(m_pResourceMapping, 0); pPS->BindResources(m_pResourceMapping, 0); + m_pPSO->CreateShaderResourceBinding(&m_pSRB, true); + auto *FmtName = pDevice->GetTextureFormatInfo(TexFormat).Name; m_TestName.append(" ("); m_TestName.append(FmtName); @@ -281,8 +283,8 @@ void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext void TestTexturing::Draw() { m_pDeviceContext->SetPipelineState(m_pPSO); - m_pDeviceContext->TransitionShaderResources(m_pPSO, nullptr); - m_pDeviceContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES); + m_pDeviceContext->TransitionShaderResources(m_pPSO, m_pSRB); + m_pDeviceContext->CommitShaderResources(m_pSRB, COMMIT_SHADER_RESOURCES_FLAG_VERIFY_STATES); IBuffer *pBuffs[] = {m_pVertexBuff}; Uint32 Offsets[] = {0}; -- cgit v1.2.3