diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-03-10 06:22:54 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:19 +0000 |
| commit | e4691d86aaf106dbe08563a4f3712d350c8503f9 (patch) | |
| tree | 97067baef0fe05d075e4a3e796b09f217e08bfbd /Graphics/GraphicsEngineVulkan | |
| parent | Unified PRS hash calculation (diff) | |
| download | DiligentCore-e4691d86aaf106dbe08563a4f3712d350c8503f9.tar.gz DiligentCore-e4691d86aaf106dbe08563a4f3712d350c8503f9.zip | |
Unified implementation of IPipelineResourceSignature::IsCompatibleWith
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
3 files changed, 1 insertions, 42 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp index 80b6c2f2..935367dd 100644 --- a/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp +++ b/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp @@ -116,16 +116,6 @@ public: bool HasDescriptorSet(DESCRIPTOR_SET_ID SetId) const { return m_VkDescrSetLayouts[SetId] != VK_NULL_HANDLE; } - /// Implementation of IPipelineResourceSignature::IsCompatibleWith. - virtual bool DILIGENT_CALL_TYPE IsCompatibleWith(const IPipelineResourceSignature* pPRS) const override final - { - if (pPRS == nullptr) - { - return GetHash() == 0; - } - return IsCompatibleWith(*ValidatedCast<const PipelineResourceSignatureVkImpl>(pPRS)); - } - void InitSRBResourceCache(ShaderResourceCacheVk& ResourceCache); // Copies static resources from the static resource cache to the destination cache @@ -146,13 +136,6 @@ public: void CommitDynamicResources(const ShaderResourceCacheVk& ResourceCache, VkDescriptorSet vkDynamicDescriptorSet) const; - bool IsCompatibleWith(const PipelineResourceSignatureVkImpl& Other) const; - - bool IsIncompatibleWith(const PipelineResourceSignatureVkImpl& Other) const - { - return GetHash() != Other.GetHash(); - } - #ifdef DILIGENT_DEVELOPMENT /// Verifies committed resource attribs using the SPIRV resource attributes from the PSO. bool DvpValidateCommittedResource(const SPIRVShaderResourceAttribs& SPIRVAttribs, diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 91faf339..d2885d5f 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -488,7 +488,7 @@ void DeviceContextVkImpl::DvpValidateCommittedShaderResources() const auto* pSRBSign = pSRB->GetSignature(); DEV_CHECK_ERR(pSRBSign != nullptr, "SRB must not be null"); - if (!pSign->IsCompatibleWith(*pSRBSign)) + if (!pSign->IsCompatibleWith(pSRBSign)) { LOG_ERROR_MESSAGE("Shader resource binding at index ", i, " with signature '", pSRBSign->GetDesc().Name, "' is not compatible with pipeline layout in current pipeline '", m_pPipelineState->GetDesc().Name, "'."); diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp index 36f72f89..0d082479 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp @@ -566,30 +566,6 @@ void PipelineResourceSignatureVkImpl::Destruct() TPipelineResourceSignatureBase::Destruct(); } -bool PipelineResourceSignatureVkImpl::IsCompatibleWith(const PipelineResourceSignatureVkImpl& Other) const -{ - if (this == &Other) - return true; - - if (GetHash() != Other.GetHash()) - return false; - - if (!PipelineResourceSignaturesCompatible(GetDesc(), Other.GetDesc())) - return false; - - const auto ResCount = GetTotalResourceCount(); - VERIFY_EXPR(ResCount == Other.GetTotalResourceCount()); - for (Uint32 r = 0; r < ResCount; ++r) - { - const auto& Res = GetResourceAttribs(r); - const auto& OtherRes = Other.GetResourceAttribs(r); - if (!Res.IsCompatibleWith(OtherRes)) - return false; - } - - return true; -} - void PipelineResourceSignatureVkImpl::InitSRBResourceCache(ShaderResourceCacheVk& ResourceCache) { const auto NumSets = GetNumDescriptorSets(); |
