Base implementation of a shader variable. More...
#include <ShaderResourceVariableBase.hpp>
Public Member Functions | |
virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface) override |
Queries the specific interface. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef () override final |
Increments the number of strong references by 1. | |
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release () override final |
virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const override final |
virtual void DILIGENT_CALL_TYPE | Set (IDeviceObject *pObject, SET_SHADER_RESOURCE_FLAGS Flags) override final |
Binds resource to the variable. | |
virtual void DILIGENT_CALL_TYPE | SetArray (IDeviceObject *const *ppObjects, Uint32 FirstElement, Uint32 NumElements, SET_SHADER_RESOURCE_FLAGS Flags) override final |
Binds resource array to the variable. | |
virtual void DILIGENT_CALL_TYPE | SetBufferRange (IDeviceObject *pObject, Uint64 Offset, Uint64 Size, Uint32 ArrayIndex, SET_SHADER_RESOURCE_FLAGS Flags) override |
Binds the specified constant buffer range to the variable. | |
virtual void DILIGENT_CALL_TYPE | SetBufferOffset (Uint32 Offset, Uint32 ArrayIndex) override final |
Sets the constant or structured buffer dynamic offset. | |
virtual SHADER_RESOURCE_VARIABLE_TYPE DILIGENT_CALL_TYPE | GetType () const override final |
Returns the shader resource variable type. | |
virtual void DILIGENT_CALL_TYPE | GetResourceDesc (ShaderResourceDesc &ResourceDesc) const override final |
Returns shader resource description. See Diligent::ShaderResourceDesc. | |
virtual Uint32 DILIGENT_CALL_TYPE | GetIndex () const override final |
Returns the variable index that can be used to access the variable. | |
![]() | |
virtual IDeviceObject *DILIGENT_CALL_TYPE | Get (Uint32 ArrayIndex=0) const =0 |
Returns a pointer to the resource that is bound to this variable. | |
Base implementation of a shader variable.
|
inlinefinaloverridevirtual |
Increments the number of strong references by 1.
Implements Diligent.IObject.
|
inlinefinaloverridevirtual |
Returns the pointer to IReferenceCounters interface of the associated reference counters object. The method does NOT increment the number of strong references to the returned object.
Implements Diligent.IObject.
|
inlineoverridevirtual |
Queries the specific interface.
[in] | IID | - Unique identifier of the requested interface. |
[out] | ppInterface | - Memory address where the pointer to the requested interface will be written. If the interface is not supported, null pointer will be returned. |
Implements Diligent.IObject.
|
inlinefinaloverridevirtual |
Decrements the number of strong references by 1 and destroys the object when the counter reaches zero.
Implements Diligent.IObject.
|
inlinefinaloverridevirtual |
Binds resource to the variable.
The method performs run-time correctness checks. For instance, shader resource view cannot be assigned to a constant buffer variable.
Implements Diligent.IShaderResourceVariable.
|
inlinefinaloverridevirtual |
Binds resource array to the variable.
[in] | ppObjects | - a pointer to the array of objects. |
[in] | FirstElement | - first array element to set. |
[in] | NumElements | - the number of objects in ppObjects array. |
[in] | Flags | - flags, see Diligent::SET_SHADER_RESOURCE_FLAGS. |
The method performs run-time correctness checks. For instance, shader resource view cannot be assigned to a constant buffer variable.
Implements Diligent.IShaderResourceVariable.
|
inlinefinaloverridevirtual |
Sets the constant or structured buffer dynamic offset.
[in] | Offset | - additional offset, in bytes, that is added to the base offset (see remarks). Only 32-bit offsets are supported. |
[in] | ArrayIndex | - for array variables, index of the array element. |
This method is only allowed for constant or structured buffer variables that were not created with Diligent::SHADER_VARIABLE_FLAG_NO_DYNAMIC_BUFFERS or Diligent::PIPELINE_RESOURCE_FLAG_NO_DYNAMIC_BUFFERS flags. The method is also not allowed for static resource variables.
For constant buffers, the offset is added to the offset that was previously set by SetBufferRange() method (if any). For structured buffers, the offset is added to the base offset specified by the buffer view.
Changing the buffer offset does not require committing the SRB. From the engine point of view, buffers with dynamic offsets are treated similar to dynamic buffers, and thus affected by Diligent::DRAW_FLAG_DYNAMIC_RESOURCE_BUFFERS_INTACT flag.
Implements Diligent.IShaderResourceVariable.
|
inlineoverridevirtual |
Binds the specified constant buffer range to the variable.
[in] | pObject | - pointer to the buffer object. |
[in] | Offset | - offset, in bytes, to the start of the buffer range to bind. |
[in] | Size | - size, in bytes, of the buffer range to bind. |
[in] | ArrayIndex | - for array variables, index of the array element. |
[in] | Flags | - flags, see Diligent::SET_SHADER_RESOURCE_FLAGS. |
This method is only allowed for constant buffers. If dynamic offset is further set by SetBufferOffset() method, it is added to the base offset set by this method.
The method resets dynamic offset previously set for this variable to zero.
Implements Diligent.IShaderResourceVariable.