From ef1e1c02e4f44b3a37c6bb683090b4f661aadcdc Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 18 Mar 2021 15:05:18 -0700 Subject: Removed duplicate code from unbinding incompatible signatures logic in D3D11, GL and Vk --- .../src/DeviceContextGLImpl.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 1bff455e..4895efc0 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -169,29 +169,9 @@ void DeviceContextGLImpl::SetPipelineState(IPipelineState* pPipelineState) } #ifdef DILIGENT_DEVELOPMENT - // Find the first incompatible shader resource bindings - Uint32 sign = 0; - for (; sign < SignCount; ++sign) - { - const auto* pLayoutSign = m_pPipelineState->GetResourceSignature(sign); - const auto* pSRBSign = m_BindInfo.SRBs[sign] != nullptr ? m_BindInfo.SRBs[sign]->GetSignature() : nullptr; - - if ((pLayoutSign == nullptr || pLayoutSign->GetTotalResourceCount() == 0) != (pSRBSign == nullptr || pSRBSign->GetTotalResourceCount() == 0)) - { - // One signature is null or empty while the other is not - SRB is not compatible with the layout. - break; - } - - if (pLayoutSign != nullptr && pSRBSign != nullptr && pLayoutSign->IsIncompatibleWith(*pSRBSign)) - { - // Signatures are incompatible - break; - } - } - // Unbind incompatible SRB and SRB with a higher binding index. // This is the same behavior that used in Vulkan backend. - for (; sign < SignCount; ++sign) + for (auto sign = DvpGetCompatibleSignatureCount(m_BindInfo.SRBs.data()); sign < SignCount; ++sign) { m_BindInfo.SRBs[sign] = nullptr; m_BindInfo.ClearStaleSRBBit(sign); -- cgit v1.2.3