Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::IShaderResourceBinding Struct Referenceabstract

Shader resource binding interface. More...

#include <ShaderResourceBinding.h>

Inheritance diagram for Diligent::IShaderResourceBinding:
Diligent.IObject Diligent::IShaderResourceBindingD3D11 Diligent::IShaderResourceBindingD3D12 Diligent::IShaderResourceBindingGL Diligent::IShaderResourceBindingMtl Diligent::IShaderResourceBindingVk Diligent::IShaderResourceBindingWebGPU

Public Member Functions

virtual struct IPipelineResourceSignature *DILIGENT_CALL_TYPE GetPipelineResourceSignature () const =0
 
virtual void DILIGENT_CALL_TYPE BindResources (SHADER_TYPE ShaderStages, IResourceMapping *pResMapping, BIND_SHADER_RESOURCES_FLAGS Flags)=0
 Binds SRB resources using the resource mapping.
 
virtual SHADER_RESOURCE_VARIABLE_TYPE_FLAGS DILIGENT_CALL_TYPE CheckResources (SHADER_TYPE ShaderStages, IResourceMapping *pResMapping, BIND_SHADER_RESOURCES_FLAGS Flags) const =0
 Checks currently bound resources, see remarks.
 
virtual IShaderResourceVariable *DILIGENT_CALL_TYPE GetVariableByName (SHADER_TYPE ShaderType, const Char *Name)=0
 Returns the variable by its name.
 
virtual Uint32 DILIGENT_CALL_TYPE GetVariableCount (SHADER_TYPE ShaderType) const =0
 Returns the total variable count for the specific shader stage.
 
virtual IShaderResourceVariable *DILIGENT_CALL_TYPE GetVariableByIndex (SHADER_TYPE ShaderType, Uint32 Index)=0
 Returns the variable by its index.
 
virtual Bool DILIGENT_CALL_TYPE StaticResourcesInitialized () const =0
 Returns true if static resources have been initialized in this SRB.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
 
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0
 

Detailed Description

Shader resource binding interface.

Member Function Documentation

◆ BindResources()

virtual void DILIGENT_CALL_TYPE Diligent::IShaderResourceBinding::BindResources ( SHADER_TYPE ShaderStages,
IResourceMapping * pResMapping,
BIND_SHADER_RESOURCES_FLAGS Flags )
pure virtual

Binds SRB resources using the resource mapping.

Parameters
[in]ShaderStages- Flags that specify shader stages, for which resources will be bound. Any combination of Diligent::SHADER_TYPE may be used.
[in]pResMapping- Shader resource mapping where required resources will be looked up.
[in]Flags- Additional flags. See Diligent::BIND_SHADER_RESOURCES_FLAGS.

◆ CheckResources()

virtual SHADER_RESOURCE_VARIABLE_TYPE_FLAGS DILIGENT_CALL_TYPE Diligent::IShaderResourceBinding::CheckResources ( SHADER_TYPE ShaderStages,
IResourceMapping * pResMapping,
BIND_SHADER_RESOURCES_FLAGS Flags ) const
pure virtual

Checks currently bound resources, see remarks.

Parameters
[in]ShaderStages- Flags that specify shader stages, for which to check resources. Any combination of Diligent::SHADER_TYPE may be used.
[in]pResMapping- Optional shader resource mapping where resources will be looked up. May be null.
[in]Flags- Additional flags, see remarks.
Returns
Variable type flags that did not pass the checks and thus may need to be updated.

This method may be used to perform various checks of the currently bound resources:

◆ GetPipelineResourceSignature()

virtual struct IPipelineResourceSignature *DILIGENT_CALL_TYPE Diligent::IShaderResourceBinding::GetPipelineResourceSignature ( ) const
pure virtual

Returns a pointer to the pipeline resource signature object that defines the layout of this shader resource binding object. The method does NOT increment the reference counter of the returned object, so Release() must not be called.

◆ GetVariableByIndex()

virtual IShaderResourceVariable *DILIGENT_CALL_TYPE Diligent::IShaderResourceBinding::GetVariableByIndex ( SHADER_TYPE ShaderType,
Uint32 Index )
pure virtual

Returns the variable by its index.

Parameters
[in]ShaderType- Type of the shader to look up the variable. Must be one of Diligent::SHADER_TYPE.
[in]Index- Variable index. The index must be between 0 and the total number of variables in this shader stage as returned by IShaderResourceBinding::GetVariableCount().

Only mutable and dynamic variables can be accessed through this method. Static variables are accessed through the Shader object.

Note
This operation may potentially be expensive. If the variable will be used often, it is recommended to store and reuse the pointer as it never changes.

◆ GetVariableByName()

virtual IShaderResourceVariable *DILIGENT_CALL_TYPE Diligent::IShaderResourceBinding::GetVariableByName ( SHADER_TYPE ShaderType,
const Char * Name )
pure virtual

Returns the variable by its name.

Parameters
[in]ShaderType- Type of the shader to look up the variable. Must be one of Diligent::SHADER_TYPE.
[in]Name- Variable name.
Note
This operation may potentially be expensive. If the variable will be used often, it is recommended to store and reuse the pointer as it never changes.

◆ GetVariableCount()

virtual Uint32 DILIGENT_CALL_TYPE Diligent::IShaderResourceBinding::GetVariableCount ( SHADER_TYPE ShaderType) const
pure virtual

Returns the total variable count for the specific shader stage.

Parameters
[in]ShaderType- Type of the shader.
Returns
Total number of variables in the shader stage.

The method only counts mutable and dynamic variables that can be accessed through the Shader Resource Binding object. Static variables are accessed through the Shader object.