summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-03-11 04:58:49 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:20 +0000
commit6e54a0840da780c3b208bc72294aa33eecc64738 (patch)
tree2b3cd3d88cf89a3fb7e16a73692c25af15f2273a /Graphics
parentVk backend: moved resource binding logic to variable manager and cache (diff)
downloadDiligentCore-6e54a0840da780c3b208bc72294aa33eecc64738.tar.gz
DiligentCore-6e54a0840da780c3b208bc72294aa33eecc64738.zip
Moved duplicate shader variable functionality to ShaderVariableBase
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp48
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderVariableManagerD3D12.hpp37
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderVariableManagerD3D12.cpp11
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp118
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp18
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderVariableManagerVk.hpp44
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVariableManagerVk.cpp13
7 files changed, 80 insertions, 209 deletions
diff --git a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
index 7b8115a9..e35cdb96 100644
--- a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
+++ b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
@@ -493,12 +493,14 @@ std::string GetShaderGroupName(const ShaderVectorType& Shaders)
}
/// Base implementation of a shader variable
-template <typename VarManagerType,
+template <typename ThisImplType,
+ typename VarManagerType,
typename ResourceVariableBaseInterface = IShaderResourceVariable>
struct ShaderVariableBase : public ResourceVariableBaseInterface
{
- ShaderVariableBase(VarManagerType& ParentManager) :
- m_ParentManager{ParentManager}
+ ShaderVariableBase(VarManagerType& ParentManager, Uint32 ResIndex) :
+ m_ParentManager{ParentManager},
+ m_ResIndex{ResIndex}
{
}
@@ -530,7 +532,39 @@ struct ShaderVariableBase : public ResourceVariableBaseInterface
return m_ParentManager.GetOwner().GetReferenceCounters();
}
- template <typename ThisImplType>
+ virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
+ {
+ static_cast<ThisImplType*>(this)->BindResource(pObject, 0);
+ }
+
+ virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects,
+ Uint32 FirstElement,
+ Uint32 NumElements) override final
+ {
+ const auto& Desc = GetDesc();
+ VerifyAndCorrectSetArrayArguments(Desc.Name, Desc.ArraySize, FirstElement, NumElements);
+ for (Uint32 elem = 0; elem < NumElements; ++elem)
+ static_cast<ThisImplType*>(this)->BindResource(ppObjects[elem], FirstElement + elem);
+ }
+
+ virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final
+ {
+ return GetDesc().VarType;
+ }
+
+ virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final
+ {
+ const auto& Desc = GetDesc();
+ ResourceDesc.Name = Desc.Name;
+ ResourceDesc.Type = Desc.ResourceType;
+ ResourceDesc.ArraySize = Desc.ArraySize;
+ }
+
+ virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final
+ {
+ return m_ParentManager.GetVariableIndex(*static_cast<const ThisImplType*>(this));
+ }
+
void BindResources(IResourceMapping* pResourceMapping, Uint32 Flags)
{
auto* const pThis = static_cast<ThisImplType*>(this);
@@ -564,8 +598,14 @@ struct ShaderVariableBase : public ResourceVariableBaseInterface
}
}
+ const PipelineResourceDesc& GetDesc() const { return m_ParentManager.GetResourceDesc(m_ResIndex); }
+
protected:
+ // Variable manager that owns this variable
VarManagerType& m_ParentManager;
+
+ // Resource index in pipeline resource signature m_Desc.Resources[]
+ const Uint32 m_ResIndex;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderVariableManagerD3D12.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderVariableManagerD3D12.hpp
index a067592e..4b53fe89 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderVariableManagerD3D12.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderVariableManagerD3D12.hpp
@@ -120,6 +120,8 @@ public:
private:
friend ShaderVariableD3D12Impl;
+ friend ShaderVariableBase<ShaderVariableD3D12Impl, ShaderVariableManagerD3D12, IShaderResourceVariableD3D>;
+
using ResourceAttribs = PipelineResourceAttribsD3D12;
Uint32 GetVariableIndex(const ShaderVariableD3D12Impl& Variable);
@@ -151,14 +153,13 @@ private:
};
// sizeof(ShaderVariableD3D12Impl) == 24 (x64)
-class ShaderVariableD3D12Impl final : public ShaderVariableBase<ShaderVariableManagerD3D12, IShaderResourceVariableD3D>
+class ShaderVariableD3D12Impl final : public ShaderVariableBase<ShaderVariableD3D12Impl, ShaderVariableManagerD3D12, IShaderResourceVariableD3D>
{
public:
- using TBase = ShaderVariableBase<ShaderVariableManagerD3D12, IShaderResourceVariableD3D>;
+ using TBase = ShaderVariableBase<ShaderVariableD3D12Impl, ShaderVariableManagerD3D12, IShaderResourceVariableD3D>;
ShaderVariableD3D12Impl(ShaderVariableManagerD3D12& ParentManager,
Uint32 ResIndex) :
- TBase{ParentManager},
- m_ResIndex{ResIndex}
+ TBase{ParentManager, ResIndex}
{}
// clang-format off
@@ -181,31 +182,6 @@ public:
}
}
- virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final
- {
- return GetDesc().VarType;
- }
-
- virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
- {
- BindResource(pObject, 0);
- }
-
- virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements) override final;
-
- virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final
- {
- const auto& Desc = GetDesc();
- ResourceDesc.Name = Desc.Name;
- ResourceDesc.Type = Desc.ResourceType;
- ResourceDesc.ArraySize = Desc.ArraySize;
- }
-
- virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final
- {
- return m_ParentManager.GetVariableIndex(*this);
- }
-
virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final
{
return m_ParentManager.IsBound(ArrayIndex, m_ResIndex);
@@ -233,9 +209,6 @@ private:
{
return m_ParentManager.GetResourceAttribs(m_ResIndex);
}
-
-private:
- const Uint32 m_ResIndex;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderVariableManagerD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderVariableManagerD3D12.cpp
index a47583a1..2d335863 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderVariableManagerD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderVariableManagerD3D12.cpp
@@ -198,19 +198,10 @@ void ShaderVariableManagerD3D12::BindResources(IResourceMapping* pResourceMappin
for (Uint32 v = 0; v < m_NumVariables; ++v)
{
- m_pVariables[v].BindResources<ShaderVariableD3D12Impl>(pResourceMapping, Flags);
+ m_pVariables[v].BindResources(pResourceMapping, Flags);
}
}
-void ShaderVariableD3D12Impl::SetArray(IDeviceObject* const* ppObjects, Uint32 FirstElement, Uint32 NumElements)
-{
- const auto& ResDesc = GetDesc();
- VerifyAndCorrectSetArrayArguments(ResDesc.Name, ResDesc.ArraySize, FirstElement, NumElements);
-
- for (Uint32 Elem = 0; Elem < NumElements; ++Elem)
- BindResource(ppObjects[Elem], FirstElement + Elem);
-}
-
namespace
{
diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp b/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp
index e028f566..cadf1eee 100644
--- a/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp
+++ b/Graphics/GraphicsEngineOpenGL/include/ShaderVariableManagerGL.hpp
@@ -63,7 +63,7 @@ namespace Diligent
class PipelineResourceSignatureGLImpl;
-// sizeof(ShaderVariableManagerGL) == 48 (x64, msvc, Release)
+// sizeof(ShaderVariableManagerGL) == 40 (x64, msvc, Release)
class ShaderVariableManagerGL
{
public:
@@ -99,68 +99,28 @@ public:
// These two methods can't be implemented in the header because they depend on PipelineResourceSignatureGLImpl
const PipelineResourceDesc& GetResourceDesc(Uint32 Index) const;
- const ResourceAttribs& GetAttribs(Uint32 Index) const;
+ const ResourceAttribs& GetResourceAttribs(Uint32 Index) const;
-
- struct GLVariableBase : public ShaderVariableBase<ShaderVariableManagerGL>
+ template <typename ThisImplType>
+ struct GLVariableBase : public ShaderVariableBase<ThisImplType, ShaderVariableManagerGL>
{
public:
- using TBase = ShaderVariableBase<ShaderVariableManagerGL>;
GLVariableBase(ShaderVariableManagerGL& ParentLayout, Uint32 ResIndex) :
- TBase{ParentLayout},
- m_ResIndex{ResIndex}
+ ShaderVariableBase<ThisImplType, ShaderVariableManagerGL>{ParentLayout, ResIndex}
{}
- const PipelineResourceDesc& GetDesc() const { return m_ParentManager.GetResourceDesc(m_ResIndex); }
- const ResourceAttribs& GetAttribs() const { return m_ParentManager.GetAttribs(m_ResIndex); }
-
- virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final
- {
- return GetDesc().VarType;
- }
-
- virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final
- {
- const auto& Desc = GetDesc();
- ResourceDesc.Name = Desc.Name;
- ResourceDesc.Type = Desc.ResourceType;
- ResourceDesc.ArraySize = Desc.ArraySize;
- }
-
- virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final
- {
- return m_ParentManager.GetVariableIndex(*this);
- }
-
- private:
- const Uint32 m_ResIndex;
+ const ResourceAttribs& GetAttribs() const { return this->m_ParentManager.GetResourceAttribs(this->m_ResIndex); }
};
- struct UniformBuffBindInfo final : GLVariableBase
+ struct UniformBuffBindInfo final : GLVariableBase<UniformBuffBindInfo>
{
UniformBuffBindInfo(ShaderVariableManagerGL& ParentLayout, Uint32 ResIndex) :
- GLVariableBase{ParentLayout, ResIndex}
+ GLVariableBase<UniformBuffBindInfo>{ParentLayout, ResIndex}
{}
- // Non-virtual function
void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex);
- virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
- {
- BindResource(pObject, 0);
- }
-
- virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects,
- Uint32 FirstElement,
- Uint32 NumElements) override final
- {
- const auto& Desc = GetDesc();
- VerifyAndCorrectSetArrayArguments(Desc.Name, Desc.ArraySize, FirstElement, NumElements);
- for (Uint32 elem = 0; elem < NumElements; ++elem)
- BindResource(ppObjects[elem], FirstElement + elem);
- }
-
virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final
{
VERIFY_EXPR(ArrayIndex < GetDesc().ArraySize);
@@ -169,30 +129,14 @@ public:
};
- struct TextureBindInfo final : GLVariableBase
+ struct TextureBindInfo final : GLVariableBase<TextureBindInfo>
{
TextureBindInfo(ShaderVariableManagerGL& ParentLayout, Uint32 ResIndex) :
- GLVariableBase{ParentLayout, ResIndex}
+ GLVariableBase<TextureBindInfo>{ParentLayout, ResIndex}
{}
- // Non-virtual function
void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex);
- virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
- {
- BindResource(pObject, 0);
- }
-
- virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects,
- Uint32 FirstElement,
- Uint32 NumElements) override final
- {
- const auto& Desc = GetDesc();
- VerifyAndCorrectSetArrayArguments(Desc.Name, Desc.ArraySize, FirstElement, NumElements);
- for (Uint32 elem = 0; elem < NumElements; ++elem)
- BindResource(ppObjects[elem], FirstElement + elem);
- }
-
virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final
{
const auto& Desc = GetDesc();
@@ -203,30 +147,14 @@ public:
};
- struct ImageBindInfo final : GLVariableBase
+ struct ImageBindInfo final : GLVariableBase<ImageBindInfo>
{
ImageBindInfo(ShaderVariableManagerGL& ParentLayout, Uint32 ResIndex) :
- GLVariableBase{ParentLayout, ResIndex}
+ GLVariableBase<ImageBindInfo>{ParentLayout, ResIndex}
{}
- // Provide non-virtual function
void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex);
- virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
- {
- BindResource(pObject, 0);
- }
-
- virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects,
- Uint32 FirstElement,
- Uint32 NumElements) override final
- {
- const auto& Desc = GetDesc();
- VerifyAndCorrectSetArrayArguments(Desc.Name, Desc.ArraySize, FirstElement, NumElements);
- for (Uint32 elem = 0; elem < NumElements; ++elem)
- BindResource(ppObjects[elem], FirstElement + elem);
- }
-
virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final
{
const auto& Desc = GetDesc();
@@ -237,30 +165,14 @@ public:
};
- struct StorageBufferBindInfo final : GLVariableBase
+ struct StorageBufferBindInfo final : GLVariableBase<StorageBufferBindInfo>
{
StorageBufferBindInfo(ShaderVariableManagerGL& ParentLayout, Uint32 ResIndex) :
- GLVariableBase{ParentLayout, ResIndex}
+ GLVariableBase<StorageBufferBindInfo>{ParentLayout, ResIndex}
{}
- // Non-virtual function
void BindResource(IDeviceObject* pObject, Uint32 ArrayIndex);
- virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
- {
- BindResource(pObject, 0);
- }
-
- virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects,
- Uint32 FirstElement,
- Uint32 NumElements) override final
- {
- const auto& Desc = GetDesc();
- VerifyAndCorrectSetArrayArguments(Desc.Name, Desc.ArraySize, FirstElement, NumElements);
- for (Uint32 elem = 0; elem < NumElements; ++elem)
- BindResource(ppObjects[elem], FirstElement + elem);
- }
-
virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final
{
VERIFY_EXPR(ArrayIndex < GetDesc().ArraySize);
@@ -297,7 +209,7 @@ public:
return reinterpret_cast<const ResourceType*>(reinterpret_cast<const Uint8*>(m_ResourceBuffer) + Offset)[ResIndex];
}
- Uint32 GetVariableIndex(const GLVariableBase& Var) const;
+ Uint32 GetVariableIndex(const IShaderResourceVariable& Var) const;
private:
struct ResourceCounters
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp
index 4294f2e8..1ad70b17 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderVariableManagerGL.cpp
@@ -97,7 +97,7 @@ void ShaderVariableManagerGL::Initialize(const PipelineResourceSignatureGLImpl&
m_pDbgAllocator = &Allocator;
#endif
- auto Counters = CountResources(Signature, AllowedVarTypes, NumAllowedTypes, ShaderType);
+ const auto Counters = CountResources(Signature, AllowedVarTypes, NumAllowedTypes, ShaderType);
m_pSignature = &Signature;
@@ -254,7 +254,7 @@ void ShaderVariableManagerGL::TextureBindInfo::BindResource(IDeviceObject* pView
RESOURCE_DIM_UNDEFINED, false, CachedTexSampler.pView.RawPtr());
if (ImmutableSamplerAssigned && ResourceCache.GetContentType() == ResourceCacheContentType::SRB)
{
- VERIFY(CachedTexSampler.pSampler != nullptr, "Immutable samplers must be initialized in the SRB cache by PipelineResourceSignatureGLImpl::InitializeSRBResourceCache!");
+ VERIFY(CachedTexSampler.pSampler != nullptr, "Immutable samplers must be initialized in the SRB cache by PipelineResourceSignatureGLImpl::InitSRBResourceCache!");
}
if (Desc.ResourceType == SHADER_RESOURCE_TYPE_INPUT_ATTACHMENT)
{
@@ -403,16 +403,16 @@ void ShaderVariableManagerGL::BindResources(IResourceMapping* pResourceMapping,
HandleResources(
[&](UniformBuffBindInfo& ub) {
- ub.BindResources<UniformBuffBindInfo>(pResourceMapping, Flags);
+ ub.BindResources(pResourceMapping, Flags);
},
[&](TextureBindInfo& tex) {
- tex.BindResources<TextureBindInfo>(pResourceMapping, Flags);
+ tex.BindResources(pResourceMapping, Flags);
},
[&](ImageBindInfo& img) {
- img.BindResources<ImageBindInfo>(pResourceMapping, Flags);
+ img.BindResources(pResourceMapping, Flags);
},
[&](StorageBufferBindInfo& ssbo) {
- ssbo.BindResources<StorageBufferBindInfo>(pResourceMapping, Flags);
+ ssbo.BindResources(pResourceMapping, Flags);
});
}
@@ -505,7 +505,7 @@ IShaderResourceVariable* ShaderVariableManagerGL::GetVariable(Uint32 Index) cons
class ShaderVariableIndexLocator
{
public:
- ShaderVariableIndexLocator(const ShaderVariableManagerGL& _Layout, const ShaderVariableManagerGL::GLVariableBase& Variable) :
+ ShaderVariableIndexLocator(const ShaderVariableManagerGL& _Layout, const IShaderResourceVariable& Variable) :
// clang-format off
Layout {_Layout},
VarOffset(reinterpret_cast<const Uint8*>(&Variable) - reinterpret_cast<const Uint8*>(_Layout.m_ResourceBuffer))
@@ -542,7 +542,7 @@ private:
};
-Uint32 ShaderVariableManagerGL::GetVariableIndex(const GLVariableBase& Var) const
+Uint32 ShaderVariableManagerGL::GetVariableIndex(const IShaderResourceVariable& Var) const
{
if (!m_ResourceBuffer)
{
@@ -574,7 +574,7 @@ const PipelineResourceDesc& ShaderVariableManagerGL::GetResourceDesc(Uint32 Inde
return m_pSignature->GetResourceDesc(Index);
}
-const ShaderVariableManagerGL::ResourceAttribs& ShaderVariableManagerGL::GetAttribs(Uint32 Index) const
+const ShaderVariableManagerGL::ResourceAttribs& ShaderVariableManagerGL::GetResourceAttribs(Uint32 Index) const
{
VERIFY_EXPR(m_pSignature);
return m_pSignature->GetResourceAttribs(Index);
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVariableManagerVk.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderVariableManagerVk.hpp
index 06db6075..3869e64d 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderVariableManagerVk.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderVariableManagerVk.hpp
@@ -115,6 +115,8 @@ public:
private:
friend ShaderVariableVkImpl;
+ friend ShaderVariableBase<ShaderVariableVkImpl, ShaderVariableManagerVk, IShaderResourceVariable>;
+
using ResourceAttribs = PipelineResourceAttribsVk;
Uint32 GetVariableIndex(const ShaderVariableVkImpl& Variable);
@@ -146,15 +148,14 @@ private:
};
// sizeof(ShaderVariableVkImpl) == 24 (x64)
-class ShaderVariableVkImpl final : public ShaderVariableBase<ShaderVariableManagerVk, IShaderResourceVariable>
+class ShaderVariableVkImpl final : public ShaderVariableBase<ShaderVariableVkImpl, ShaderVariableManagerVk, IShaderResourceVariable>
{
public:
- using TBase = ShaderVariableBase<ShaderVariableManagerVk, IShaderResourceVariable>;
+ using TBase = ShaderVariableBase<ShaderVariableVkImpl, ShaderVariableManagerVk, IShaderResourceVariable>;
ShaderVariableVkImpl(ShaderVariableManagerVk& ParentManager,
Uint32 ResIndex) :
- TBase{ParentManager},
- m_ResIndex{ResIndex}
+ TBase{ParentManager, ResIndex}
{}
// clang-format off
@@ -164,43 +165,11 @@ public:
ShaderVariableVkImpl& operator= (ShaderVariableVkImpl&&) = delete;
// clang-format on
- virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE GetType() const override final
- {
- return GetDesc().VarType;
- }
-
- virtual void DILIGENT_CALL_TYPE Set(IDeviceObject* pObject) override final
- {
- BindResource(pObject, 0);
- }
-
- virtual void DILIGENT_CALL_TYPE SetArray(IDeviceObject* const* ppObjects,
- Uint32 FirstElement,
- Uint32 NumElements) override final;
-
- virtual void DILIGENT_CALL_TYPE GetResourceDesc(ShaderResourceDesc& ResourceDesc) const override final
- {
- const auto& Desc = GetDesc();
- ResourceDesc.Name = Desc.Name;
- ResourceDesc.Type = Desc.ResourceType;
- ResourceDesc.ArraySize = Desc.ArraySize;
- }
-
- virtual Uint32 DILIGENT_CALL_TYPE GetIndex() const override final
- {
- return m_ParentManager.GetVariableIndex(*this);
- }
-
virtual bool DILIGENT_CALL_TYPE IsBound(Uint32 ArrayIndex) const override final
{
return m_ParentManager.IsBound(ArrayIndex, m_ResIndex);
}
- const PipelineResourceDesc& GetDesc() const
- {
- return m_ParentManager.GetResourceDesc(m_ResIndex);
- }
-
void BindResource(IDeviceObject* pObj, Uint32 ArrayIndex) const
{
return m_ParentManager.BindResource(pObj, ArrayIndex, m_ResIndex);
@@ -210,9 +179,6 @@ private:
using ResourceAttribs = PipelineResourceAttribsVk;
const ResourceAttribs& GetAttribs() const { return m_ParentManager.GetAttribs(m_ResIndex); }
-
-private:
- const Uint32 m_ResIndex; // Index in Signatures' m_Desc.Resources
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVariableManagerVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVariableManagerVk.cpp
index a159b8b9..5f4bd8d6 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVariableManagerVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVariableManagerVk.cpp
@@ -198,21 +198,10 @@ void ShaderVariableManagerVk::BindResources(IResourceMapping* pResourceMapping,
for (Uint32 v = 0; v < m_NumVariables; ++v)
{
- m_pVariables[v].BindResources<ShaderVariableVkImpl>(pResourceMapping, Flags);
+ m_pVariables[v].BindResources(pResourceMapping, Flags);
}
}
-void ShaderVariableVkImpl::SetArray(IDeviceObject* const* ppObjects,
- Uint32 FirstElement,
- Uint32 NumElements)
-{
- const auto& ResDesc = GetDesc();
- VerifyAndCorrectSetArrayArguments(ResDesc.Name, ResDesc.ArraySize, FirstElement, NumElements);
-
- for (Uint32 Elem = 0; Elem < NumElements; ++Elem)
- BindResource(ppObjects[Elem], FirstElement + Elem);
-}
-
namespace
{