summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-02-16 03:06:56 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:31:38 +0000
commit7a148ffcd6569ad21dc112c1823feb7b7477cb10 (patch)
tree0627fc491cf9a8f4424c74d67aa1fb1053d16b17 /Graphics/GraphicsEngineVulkan
parentoptimize root view updates (diff)
downloadDiligentCore-7a148ffcd6569ad21dc112c1823feb7b7477cb10.tar.gz
DiligentCore-7a148ffcd6569ad21dc112c1823feb7b7477cb10.zip
Removed duplicates of FindAssignedSampler and FindImmutableSampler functions
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp29
2 files changed, 2 insertions, 30 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp
index ea20151b..4236f7c1 100644
--- a/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp
@@ -316,9 +316,6 @@ private:
size_t CalculateHash() const;
- // Finds a separate sampler assigned to the image SepImg and returns its index in m_Desc.Resources.
- Uint32 FindAssignedSampler(const PipelineResourceDesc& SepImg) const;
-
static inline CACHE_GROUP GetResourceCacheGroup(const PipelineResourceDesc& Res);
static inline DESCRIPTOR_SET_ID VarTypeToDescriptorSetId(SHADER_RESOURCE_VARIABLE_TYPE VarType);
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp
index 000d3458..a4928130 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp
@@ -468,7 +468,7 @@ void PipelineResourceSignatureVkImpl::CreateSetLayouts(const CacheOffsetsType& C
// The sampler may not be yet initialized, but this is OK as all resources are initialized
// in the same order as in m_Desc.Resources
const auto AssignedSamplerInd = DescrType == DescriptorType::SeparateImage ?
- FindAssignedSampler(ResDesc) :
+ FindAssignedSampler(ResDesc, ResourceAttribs::InvalidSamplerInd) :
ResourceAttribs::InvalidSamplerInd;
VkSampler* pVkImmutableSamplers = nullptr;
@@ -478,7 +478,7 @@ void PipelineResourceSignatureVkImpl::CreateSetLayouts(const CacheOffsetsType& C
// Only search for immutable sampler for combined image samplers and separate samplers.
// Note that for DescriptorType::SeparateImage with immutable sampler, we will initialize
// a separate immutable sampler below. It will not be assigned to the image variable.
- Int32 SrcImmutableSamplerInd = FindImmutableSampler(ResDesc, DescrType, m_Desc, GetCombinedSamplerSuffix());
+ const auto SrcImmutableSamplerInd = FindImmutableSampler(ResDesc, DescrType, m_Desc, GetCombinedSamplerSuffix());
if (SrcImmutableSamplerInd >= 0)
{
auto& ImmutableSampler = m_ImmutableSamplers[SrcImmutableSamplerInd];
@@ -654,31 +654,6 @@ void PipelineResourceSignatureVkImpl::CreateSetLayouts(const CacheOffsetsType& C
VERIFY_EXPR(NumSets == GetNumDescriptorSets());
}
-Uint32 PipelineResourceSignatureVkImpl::FindAssignedSampler(const PipelineResourceDesc& SepImg) const
-{
- Uint32 SamplerInd = ResourceAttribs::InvalidSamplerInd;
- if (IsUsingCombinedSamplers())
- {
- const auto IdxRange = GetResourceIndexRange(SepImg.VarType);
-
- for (Uint32 i = IdxRange.first; i < IdxRange.second; ++i)
- {
- const auto& Res = m_Desc.Resources[i];
- VERIFY_EXPR(SepImg.VarType == Res.VarType);
-
- if (Res.ResourceType == SHADER_RESOURCE_TYPE_SAMPLER &&
- (SepImg.ShaderStages & Res.ShaderStages) &&
- StreqSuff(Res.Name, SepImg.Name, GetCombinedSamplerSuffix()))
- {
- VERIFY_EXPR((Res.ShaderStages & SepImg.ShaderStages) == SepImg.ShaderStages);
- SamplerInd = i;
- break;
- }
- }
- }
- return SamplerInd;
-}
-
size_t PipelineResourceSignatureVkImpl::CalculateHash() const
{
if (m_Desc.NumResources == 0 && m_Desc.NumImmutableSamplers == 0)