diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-03-18 22:05:18 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:25 +0000 |
| commit | ef1e1c02e4f44b3a37c6bb683090b4f661aadcdc (patch) | |
| tree | ab1bc97327e4596d9486fb42f3e96474edc90097 /Graphics/GraphicsEngineVulkan | |
| parent | Few updates to PipelineStateD3D11Impl (diff) | |
| download | DiligentCore-ef1e1c02e4f44b3a37c6bb683090b4f661aadcdc.tar.gz DiligentCore-ef1e1c02e4f44b3a37c6bb683090b4f661aadcdc.zip | |
Removed duplicate code from unbinding incompatible signatures logic in D3D11, GL and Vk
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 40cab0ad..32f68f9d 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -348,31 +348,11 @@ void DeviceContextVkImpl::SetPipelineState(IPipelineState* pPipelineState) // (14.2.2. Pipeline Layouts, clause 'Pipeline Layout Compatibility') // https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-compatibility - // Find the first incompatible shader resource bindings - Uint32 sign = 0; - for (; sign < SignCount; ++sign) - { - const auto* pLayoutSign = pPipelineStateVk->GetResourceSignature(sign); - const auto* pSRBSign = BindInfo.SRBs[sign] != nullptr ? BindInfo.SRBs[sign]->GetSignature() : nullptr; - - if ((pLayoutSign == nullptr || pLayoutSign->GetNumDescriptorSets() == 0) != (pSRBSign == nullptr || pSRBSign->GetNumDescriptorSets() == 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 shader resources // A consequence of layout compatibility is that when the implementation compiles a pipeline // layout and maps pipeline resources to implementation resources, the mechanism for set N // should only be a function of sets [0..N]. - for (; sign < SignCount; ++sign) + for (auto sign = DvpGetCompatibleSignatureCount(BindInfo.SRBs.data()); sign < SignCount; ++sign) { BindInfo.SRBs[sign] = nullptr; |
