The IConstantBuffer video object interface. More...
#include "murl_video_i_constant_buffer.h"
Inherited by Murl::Video::ConstantBuffer.
Public Member Functions | |
virtual IObject * | GetObjectInterface ()=0 |
Get the mutable Video::IObject interface. More... | |
virtual const IObject * | GetObjectInterface () const =0 |
Get the constant Video::IObject interface. More... | |
virtual Bool | Set (IProgram *currentProgram, SInt32 id)=0 |
Attach the constant buffer to the current GPU program. More... | |
virtual Bool | SetAccessMode (IEnums::BufferAccessMode mode)=0 |
Set the access mode hint (read only or read/write). More... | |
virtual IEnums::BufferAccessMode | GetAccessMode () const =0 |
Get the access mode hint. More... | |
virtual Bool | SetConstantData (void *constants, UInt32 maxByteSize)=0 |
Assign a mutable source data storage. More... | |
virtual Bool | SetConstantData (const void *constants, UInt32 maxByteSize)=0 |
Assign a constant source data storage. More... | |
virtual Bool | SetByteSize (UInt32 byteSize)=0 |
Set the actual size of the buffer used. More... | |
virtual Bool | SetConstantsModified ()=0 |
Mark the whole buffer as modified. More... | |
virtual Bool | SetConstantsModified (UInt32 firstConstant, UInt32 numberOfConstants)=0 |
Mark a sub-region of the buffer as modified. More... | |
virtual void * | GetConstantData ()=0 |
Get a pointer to the mutable source data, if available. More... | |
virtual const void * | GetConstantData () const =0 |
Get a constant pointer to the source data. More... | |
virtual void * | GetConstantBufferData ()=0 |
Get a pointer to the actual mutable buffer data. More... | |
virtual const void * | GetConstantBufferData () const =0 |
Get a pointer to the actual constant buffer data. More... | |
virtual UInt32 | GetMaxByteSize () const =0 |
Get the maximum number of bytes the buffer can hold. More... | |
virtual UInt32 | GetByteSize () const =0 |
Get the actual number of buffer bytes used. More... | |
virtual Bool | AreConstantsModified () const =0 |
Check if the buffer contents are modified. More... | |
virtual SInt32 | AddUniform (IEnums::UniformItem item, IEnums::UniformType type, UInt32 &byteOffset)=0 |
Add a single predefined uniform variable. More... | |
virtual SInt32 | AddUniform (SInt32 id, IEnums::UniformType type, UInt32 &byteOffset)=0 |
Add a single custom uniform variable, by its unique integer ID in the renderer. More... | |
virtual SInt32 | AddUniform (const String &name, IEnums::UniformType type, UInt32 &byteOffset)=0 |
Add a single custom uniform variable, by its actual name. More... | |
virtual Bool | RemoveAllUniforms ()=0 |
Remove all present uniform variables from the buffer. More... | |
virtual SInt32 | GetUniformIndex (IEnums::UniformItem item) const =0 |
Get the index of a predefined uniform variable in the buffer. More... | |
virtual SInt32 | GetUniformIndex (SInt32 id) const =0 |
Get the index of a custom uniform variable in the buffer, by its unique integer ID. More... | |
virtual SInt32 | GetUniformIndex (const String &name) const =0 |
Get the index of a custom uniform variable in the buffer, by its actual name. More... | |
virtual UInt32 | GetNumberOfUniforms () const =0 |
Get the total number of individual uniform variables present in the buffer. More... | |
virtual IEnums::UniformType | GetUniformType (UInt32 index) const =0 |
Get the data type of a uniform variable at a given index. More... | |
virtual IEnums::UniformItem | GetUniformItem (UInt32 index) const =0 |
Get the predefined uniform variable item at a given index. More... | |
virtual SInt32 | GetUniformId (UInt32 index) const =0 |
Get the unique integer ID of a uniform variable at a given index. More... | |
virtual UInt32 | GetUniformByteOffset (UInt32 index) const =0 |
Get the byte offset of a uniform variable relative to the buffer start. More... | |
virtual IUniform * | GetUniform (UInt32 index) const =0 |
Get the generic uniform variable at a given index. More... | |
virtual IFloatUniform * | GetFloatUniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatUniform. More... | |
virtual IFloatVector2Uniform * | GetFloatVector2Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatVector2Uniform. More... | |
virtual IFloatVector3Uniform * | GetFloatVector3Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatVector3Uniform. More... | |
virtual IFloatVector4Uniform * | GetFloatVector4Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatVector4Uniform. More... | |
virtual IFloatMatrix2Uniform * | GetFloatMatrix2Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatMatrix2Uniform. More... | |
virtual IFloatMatrix3Uniform * | GetFloatMatrix3Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatMatrix3Uniform. More... | |
virtual IFloatMatrix4Uniform * | GetFloatMatrix4Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an IFloatMatrix4Uniform. More... | |
virtual ISInt32Uniform * | GetSInt32Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an ISInt32Uniform. More... | |
virtual ISInt32Vector2Uniform * | GetSInt32Vector2Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an ISInt32Vector2Uniform. More... | |
virtual ISInt32Vector3Uniform * | GetSInt32Vector3Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an ISInt32Vector3Uniform. More... | |
virtual ISInt32Vector4Uniform * | GetSInt32Vector4Uniform (UInt32 index) const =0 |
Get the uniform variable at a given index as an ISInt32Vector4Uniform. More... | |
virtual Bool | IsEqual (const IConstantBuffer *other) const =0 |
Check if the constant buffer is equal to another one. More... | |
virtual UInt32 | GetSignature () const =0 |
Get the signature, obtained via IRenderer::AcquireConstantBufferSignature(). More... | |
Detailed Description
The IConstantBuffer video object interface.
This interface represents a buffer containing one or more individual GPU program uniform variables.
Used internally by Graph::FixedParameters and Graph::GenericParameterGroup.
Member Function Documentation
◆ GetObjectInterface() [1/2]
|
pure virtual |
Get the mutable Video::IObject interface.
- Returns
- The IObject interface.
◆ GetObjectInterface() [2/2]
|
pure virtual |
Get the constant Video::IObject interface.
- Returns
- The IObject interface.
◆ Set()
|
pure virtual |
Attach the constant buffer to the current GPU program.
- Parameters
-
currentProgram The current GPU program. id The unique integer ID of the constant buffer in the renderer.
- Returns
- true if successful.
◆ SetAccessMode()
|
pure virtual |
Set the access mode hint (read only or read/write).
- Parameters
-
mode The access mode.
- Returns
- true if successful.
◆ GetAccessMode()
|
pure virtual |
Get the access mode hint.
- Returns
- The access mode.
◆ SetConstantData() [1/2]
|
pure virtual |
Assign a mutable source data storage.
- Parameters
-
constants A pointer to the mutable buffer holding individual uniform values. maxByteSize The size of the buffer in bytes.
- Returns
- true if successful.
◆ SetConstantData() [2/2]
|
pure virtual |
Assign a constant source data storage.
- Parameters
-
constants A pointer to the constant buffer holding individual uniform values. maxByteSize The size of the buffer in bytes.
- Returns
- true if successful.
◆ SetByteSize()
Set the actual size of the buffer used.
- Parameters
-
byteSize The actual buffer size in bytes. Must be less or equal than the maximum byte size defined via SetConstantData().
- Returns
- true if successful.
◆ SetConstantsModified() [1/2]
|
pure virtual |
Mark the whole buffer as modified.
- Returns
- true if successful.
◆ SetConstantsModified() [2/2]
|
pure virtual |
Mark a sub-region of the buffer as modified.
- Parameters
-
firstConstant The first modified constant in the buffer. numberOfConstants The number of modified constants.
- Returns
- true if successful.
◆ GetConstantData() [1/2]
|
pure virtual |
Get a pointer to the mutable source data, if available.
If the source data storage was defined using a constant pointer, this method returns null.
- Returns
- A pointer to the mutable source data, or null if the source is immutable.
◆ GetConstantData() [2/2]
|
pure virtual |
Get a constant pointer to the source data.
- Returns
- A pointer to the source data.
◆ GetConstantBufferData() [1/2]
|
pure virtual |
Get a pointer to the actual mutable buffer data.
- Returns
- A pointer to the actual buffer data.
◆ GetConstantBufferData() [2/2]
|
pure virtual |
Get a pointer to the actual constant buffer data.
- Returns
- A pointer to the actual buffer data.
◆ GetMaxByteSize()
|
pure virtual |
Get the maximum number of bytes the buffer can hold.
- Returns
- The maximum buffer byte size.
◆ GetByteSize()
|
pure virtual |
Get the actual number of buffer bytes used.
- Returns
- The actual buffer byte size.
◆ AreConstantsModified()
|
pure virtual |
Check if the buffer contents are modified.
- Returns
- true if modified.
◆ AddUniform() [1/3]
|
pure virtual |
Add a single predefined uniform variable.
- Parameters
-
item The predefined item. type The uniform data type. byteOffset The offset in bytes of the uniform's location within the actual buffer data.
- Returns
- The zero-based index of the uniform in the buffer, or -1 if failed.
◆ AddUniform() [2/3]
|
pure virtual |
Add a single custom uniform variable, by its unique integer ID in the renderer.
- Parameters
-
id The uniform's unique integer ID. type The uniform data type. byteOffset The offset in bytes of the uniform's location within the actual buffer data.
- Returns
- The zero-based index of the uniform in the buffer, or -1 if failed.
◆ AddUniform() [3/3]
|
pure virtual |
Add a single custom uniform variable, by its actual name.
- Parameters
-
name The uniform variable name. type The uniform data type. byteOffset The offset in bytes of the uniform's location within the actual buffer data.
- Returns
- The zero-based index of the uniform in the buffer, or -1 if failed.
◆ RemoveAllUniforms()
|
pure virtual |
Remove all present uniform variables from the buffer.
- Returns
- true if successful.
◆ GetUniformIndex() [1/3]
|
pure virtual |
Get the index of a predefined uniform variable in the buffer.
- Parameters
-
item The uniform item to query.
- Returns
- The zero-based index of the uniform, or -1 if not found.
◆ GetUniformIndex() [2/3]
Get the index of a custom uniform variable in the buffer, by its unique integer ID.
- Parameters
-
id The unique integer ID of the variable to query.
- Returns
- The zero-based index of the uniform, or -1 if not found.
◆ GetUniformIndex() [3/3]
|
pure virtual |
Get the index of a custom uniform variable in the buffer, by its actual name.
- Parameters
-
name The uniform variable name to query.
- Returns
- The zero-based index of the uniform, or -1 if not found.
◆ GetNumberOfUniforms()
|
pure virtual |
Get the total number of individual uniform variables present in the buffer.
- Returns
- The number of uniform variables present.
◆ GetUniformType()
|
pure virtual |
Get the data type of a uniform variable at a given index.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable data type, or IEnums::UNIFORM_TYPE_UNDEFINED if the index is out of range.
◆ GetUniformItem()
|
pure virtual |
Get the predefined uniform variable item at a given index.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The predefined variable item, or IEnums::UNIFORM_ITEM_CUSTOM if the index is out of range.
◆ GetUniformId()
Get the unique integer ID of a uniform variable at a given index.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The unique ID, or -1 if the index is out of range.
◆ GetUniformByteOffset()
|
pure virtual |
Get the byte offset of a uniform variable relative to the buffer start.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The byte offset, or 0 if the index is out of range.
◆ GetUniform()
Get the generic uniform variable at a given index.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range.
◆ GetFloatUniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatUniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetFloatVector2Uniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatVector2Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetFloatVector3Uniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatVector3Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetFloatVector4Uniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatVector4Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetFloatMatrix2Uniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatMatrix2Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetFloatMatrix3Uniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatMatrix3Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetFloatMatrix4Uniform()
|
pure virtual |
Get the uniform variable at a given index as an IFloatMatrix4Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetSInt32Uniform()
|
pure virtual |
Get the uniform variable at a given index as an ISInt32Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetSInt32Vector2Uniform()
|
pure virtual |
Get the uniform variable at a given index as an ISInt32Vector2Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetSInt32Vector3Uniform()
|
pure virtual |
Get the uniform variable at a given index as an ISInt32Vector3Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ GetSInt32Vector4Uniform()
|
pure virtual |
Get the uniform variable at a given index as an ISInt32Vector4Uniform.
- Parameters
-
index The index of the variable to query, from 0 to GetNumberOfUniforms()-1.
- Returns
- The variable, or null if the index is out of range or the variable has a different data type.
◆ IsEqual()
|
pure virtual |
Check if the constant buffer is equal to another one.
- Parameters
-
other The buffer to compare with.
- Returns
- true if the buffers are equal.
◆ GetSignature()
|
pure virtual |
Get the signature, obtained via IRenderer::AcquireConstantBufferSignature().
- Returns
- The buffer signature.
The documentation for this interface was generated from the following file:
- murl_video_i_constant_buffer.h