summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-03-18 22:05:18 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:25 +0000
commitef1e1c02e4f44b3a37c6bb683090b4f661aadcdc (patch)
treeab1bc97327e4596d9486fb42f3e96474edc90097 /Graphics/GraphicsEngineD3D11
parentFew updates to PipelineStateD3D11Impl (diff)
downloadDiligentCore-ef1e1c02e4f44b3a37c6bb683090b4f661aadcdc.tar.gz
DiligentCore-ef1e1c02e4f44b3a37c6bb683090b4f661aadcdc.zip
Removed duplicate code from unbinding incompatible signatures logic in D3D11, GL and Vk
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 7524bdd7..c44a80dc 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -154,29 +154,9 @@ void DeviceContextD3D11Impl::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);
@@ -191,9 +171,9 @@ void DeviceContextD3D11Impl::SetPipelineState(IPipelineState* pPipelineState)
/// Helper macro used to create an array of device context methods to
/// set particular resource for every shader stage
#define DEFINE_D3D11CTX_FUNC_POINTERS(ArrayName, FuncName) \
- typedef decltype (&ID3D11DeviceContext::VS##FuncName) T##FuncName##Type; \
- static const T##FuncName##Type ArrayName[] = \
- { \
+ using T##FuncName##Type = decltype (&ID3D11DeviceContext::VS##FuncName); \
+ static const T##FuncName##Type ArrayName[] = \
+ { \
&ID3D11DeviceContext::VS##FuncName, \
&ID3D11DeviceContext::PS##FuncName, \
&ID3D11DeviceContext::GS##FuncName, \