Go to the documentation of this file.
53 template <
typename EngineImplTraits>
58 using BaseInterface =
typename EngineImplTraits::ShaderResourceBindingInterface;
84 for (
Uint32 s = 0; s < NumShaders; ++s)
86 const auto ShaderType = pPRS->GetActiveShaderStageType(s);
97 "Constructor of ShaderVariableManagerImplType must be noexcept, so we can safely construct all managers");
101 auto* Ptr = MemPool.ReleaseOwnership();
110 auto& SRBMemAllocator = pPRS->GetSRBMemoryAllocator();
111 for (
Uint32 s = 0; s < NumShaders; ++s)
113 const auto ShaderType = pPRS->GetActiveShaderStageType(s);
116 VERIFY_EXPR(MgrInd >= 0 && MgrInd <
static_cast<int>(NumShaders));
118 auto& VarDataAllocator = SRBMemAllocator.GetShaderVariableDataAllocator(s);
143 return m_pPRS->GetDesc().BindingIndex;
148 return m_pPRS->GetPipelineType();
153 return m_pPRS->GetNumActiveShaderStages();
169 return m_pPRS.template RawPtr<ResourceSignatureType>();
185 " as the stage is invalid for ",
GetPipelineTypeString(PipelineType),
" pipeline resource signature '",
m_pPRS->GetDesc().Name,
"'.");
205 " as the stage is invalid for ",
GetPipelineTypeString(PipelineType),
" pipeline resource signature '",
m_pPRS->GetDesc().Name,
"'.");
225 " as the stage is invalid for ",
GetPipelineTypeString(PipelineType),
" pipeline resource signature '",
m_pPRS->GetDesc().Name,
"'.");
267 auto& SRBMemAllocator =
GetSignature()->GetSRBMemoryAllocator();
270 auto& VarDataAllocator = SRBMemAllocator.GetShaderVariableDataAllocator(s);
287 static_assert(MAX_SHADERS_IN_PIPELINE == 6,
"Please update the initializer list above");
typename EngineGLImplTraits ::ShaderResourceBindingInterface BaseInterface
Definition: ShaderResourceBindingBase.hpp:58
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
Shader resource variable.
Definition: ShaderResourceVariable.h:117
void SetStaticResourcesInitialized()
Definition: ShaderResourceBindingBase.hpp:172
Pipeline resource signature interface.
Definition: PipelineResourceSignature.h:226
const ShaderResourceCacheImplType & GetResourceCache() const
Definition: ShaderResourceBindingBase.hpp:260
SHADER_TYPE
Describes the shader type.
Definition: GraphicsTypes.h:65
ShaderResourceCacheImplType & GetResourceCache()
Definition: ShaderResourceBindingBase.hpp:259
Uint32 Flags
Definition: DXBCUtils.cpp:71
std::array< Int8, MAX_SHADERS_IN_PIPELINE > m_ActiveShaderStageIndex
Definition: ShaderResourceBindingBase.hpp:286
PIPELINE_TYPE
Pipeline type.
Definition: PipelineState.h:295
virtual Uint32 GetVariableCount(SHADER_TYPE ShaderType) const override final
Implementation of IShaderResourceBinding::GetVariableCount().
Definition: ShaderResourceBindingBase.hpp:199
Template class implementing base functionality of the shader resource binding.
Definition: ShaderResourceBindingBase.hpp:54
@ SHADER_RESOURCE_VARIABLE_TYPE_DYNAMIC
Shader variable binding is dynamic. It can be set multiple times for every instance of shader resourc...
Definition: ShaderResourceVariable.h:62
Template class implementing base functionality for an object.
Definition: ObjectBase.hpp:66
ShaderVariableManagerImplType * m_pShaderVarMgrs
Definition: ShaderResourceBindingBase.hpp:290
ShaderResourceCacheImplType m_ShaderResourceCache
Definition: ShaderResourceBindingBase.hpp:287
virtual IShaderResourceVariable * GetVariableByName(SHADER_TYPE ShaderType, const char *Name) override final
Implementation of IShaderResourceBinding::GetVariableByName().
Definition: ShaderResourceBindingBase.hpp:179
Uint32 GetBindingIndex() const
Definition: ShaderResourceBindingBase.hpp:141
int32_t Int32
32-bit signed integer
Definition: BasicTypes.h:46
@ SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE
Shader resource bound to the variable is specific to the shader resource binding instance (see Dilige...
Definition: ShaderResourceVariable.h:58
int8_t Int8
8-bit signed integer
Definition: BasicTypes.h:48
IMemoryAllocator & GetRawAllocator()
Returns raw memory allocator.
Definition: EngineMemory.cpp:51
virtual void BindResources(Uint32 ShaderFlags, IResourceMapping *pResMapping, Uint32 Flags) override final
Implementation of IShaderResourceBinding::BindResources().
Definition: ShaderResourceBindingBase.hpp:239
bool IsConsistentShaderType(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1388
#define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName)
Definition: ObjectBase.hpp:59
~ShaderResourceBindingBase()
Definition: ShaderResourceBindingBase.hpp:134
Int32 GetShaderTypePipelineIndex(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1422
virtual IShaderResourceVariable * GetVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final
Implementation of IShaderResourceBinding::GetVariableByIndex().
Definition: ShaderResourceBindingBase.hpp:219
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
ShaderResourceBindingBase(IReferenceCounters *pRefCounters, ResourceSignatureType *pPRS)
Definition: ShaderResourceBindingBase.hpp:73
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Uint32 GetNumShaders() const
Definition: ShaderResourceBindingBase.hpp:151
PIPELINE_TYPE GetPipelineType() const
Definition: ShaderResourceBindingBase.hpp:146
typename EngineImplTraits::ShaderVariableManagerImplType ShaderVariableManagerImplType
Definition: ShaderResourceBindingBase.hpp:67
typename EngineGLImplTraits ::ShaderResourceCacheImplType ShaderResourceCacheImplType
Definition: ShaderResourceBindingBase.hpp:64
@ SRB
Resources of a shader resource binding.
SHADER_TYPE GetShaderTypeFromPipelineIndex(Int32 Index, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1466
#define LOG_WARNING_MESSAGE(...)
Definition: Errors.hpp:123
virtual bool StaticResourcesInitialized() const override final
Definition: ShaderResourceBindingBase.hpp:162
const char * GetPipelineTypeString(PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1145
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
const Char * GetShaderTypeLiteralName(SHADER_TYPE ShaderType)
Returns the literal name of a shader type. For instance, for a pixel shader, "SHADER_TYPE_PIXEL" will...
Definition: GraphicsAccessories.cpp:476
virtual IPipelineResourceSignature * GetPipelineResourceSignature() const override final
Implementation of IShaderResourceBinding::GetPipelineResourceSignature().
Definition: ShaderResourceBindingBase.hpp:157
ResourceSignatureType * GetSignature() const
Definition: ShaderResourceBindingBase.hpp:167
typename EngineGLImplTraits ::PipelineResourceSignatureImplType ResourceSignatureType
Definition: ShaderResourceBindingBase.hpp:61
bool m_bStaticResourcesInitialized
Definition: ShaderResourceBindingBase.hpp:292
ObjectBase< BaseInterface > TObjectBase
Definition: ShaderResourceBindingBase.hpp:69
Uint16 ShaderType
Definition: DXBCUtils.cpp:70
virtual void Free(void *Ptr)=0
Releases memory.
RefCntAutoPtr< ResourceSignatureType > m_pPRS
Strong reference to pipeline resource signature. We must use strong reference, because shader resourc...
Definition: ShaderResourceBindingBase.hpp:282
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
SHADER_RESOURCE_VARIABLE_TYPE
Describes the type of the shader resource variable.
Definition: ShaderResourceVariable.h:48
Resouce mapping.
Definition: ResourceMapping.h:107