Murl::Video::IConstantBuffer Interface Referenceabstract

The IConstantBuffer video object interface. More...

#include "murl_video_i_constant_buffer.h"

Inherited by Murl::Video::ConstantBuffer.

Public Member Functions

virtual IObjectGetObjectInterface ()=0
 Get the mutable Video::IObject interface. More...
 
virtual const IObjectGetObjectInterface () 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 IUniformGetUniform (UInt32 index) const =0
 Get the generic uniform variable at a given index. More...
 
virtual IFloatUniformGetFloatUniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatUniform. More...
 
virtual IFloatVector2UniformGetFloatVector2Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatVector2Uniform. More...
 
virtual IFloatVector3UniformGetFloatVector3Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatVector3Uniform. More...
 
virtual IFloatVector4UniformGetFloatVector4Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatVector4Uniform. More...
 
virtual IFloatMatrix2UniformGetFloatMatrix2Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatMatrix2Uniform. More...
 
virtual IFloatMatrix3UniformGetFloatMatrix3Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatMatrix3Uniform. More...
 
virtual IFloatMatrix4UniformGetFloatMatrix4Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an IFloatMatrix4Uniform. More...
 
virtual ISInt32UniformGetSInt32Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an ISInt32Uniform. More...
 
virtual ISInt32Vector2UniformGetSInt32Vector2Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an ISInt32Vector2Uniform. More...
 
virtual ISInt32Vector3UniformGetSInt32Vector3Uniform (UInt32 index) const =0
 Get the uniform variable at a given index as an ISInt32Vector3Uniform. More...
 
virtual ISInt32Vector4UniformGetSInt32Vector4Uniform (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]

virtual IObject* Murl::Video::IConstantBuffer::GetObjectInterface ( )
pure virtual

Get the mutable Video::IObject interface.

Returns
The IObject interface.

◆ GetObjectInterface() [2/2]

virtual const IObject* Murl::Video::IConstantBuffer::GetObjectInterface ( ) const
pure virtual

Get the constant Video::IObject interface.

Returns
The IObject interface.

◆ Set()

virtual Bool Murl::Video::IConstantBuffer::Set ( IProgram currentProgram,
SInt32  id 
)
pure virtual

Attach the constant buffer to the current GPU program.

Parameters
currentProgramThe current GPU program.
idThe unique integer ID of the constant buffer in the renderer.
Returns
true if successful.

◆ SetAccessMode()

virtual Bool Murl::Video::IConstantBuffer::SetAccessMode ( IEnums::BufferAccessMode  mode)
pure virtual

Set the access mode hint (read only or read/write).

Parameters
modeThe access mode.
Returns
true if successful.

◆ GetAccessMode()

virtual IEnums::BufferAccessMode Murl::Video::IConstantBuffer::GetAccessMode ( ) const
pure virtual

Get the access mode hint.

Returns
The access mode.

◆ SetConstantData() [1/2]

virtual Bool Murl::Video::IConstantBuffer::SetConstantData ( void *  constants,
UInt32  maxByteSize 
)
pure virtual

Assign a mutable source data storage.

Parameters
constantsA pointer to the mutable buffer holding individual uniform values.
maxByteSizeThe size of the buffer in bytes.
Returns
true if successful.

◆ SetConstantData() [2/2]

virtual Bool Murl::Video::IConstantBuffer::SetConstantData ( const void *  constants,
UInt32  maxByteSize 
)
pure virtual

Assign a constant source data storage.

Parameters
constantsA pointer to the constant buffer holding individual uniform values.
maxByteSizeThe size of the buffer in bytes.
Returns
true if successful.

◆ SetByteSize()

virtual Bool Murl::Video::IConstantBuffer::SetByteSize ( UInt32  byteSize)
pure virtual

Set the actual size of the buffer used.

Parameters
byteSizeThe 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]

virtual Bool Murl::Video::IConstantBuffer::SetConstantsModified ( )
pure virtual

Mark the whole buffer as modified.

Returns
true if successful.

◆ SetConstantsModified() [2/2]

virtual Bool Murl::Video::IConstantBuffer::SetConstantsModified ( UInt32  firstConstant,
UInt32  numberOfConstants 
)
pure virtual

Mark a sub-region of the buffer as modified.

Parameters
firstConstantThe first modified constant in the buffer.
numberOfConstantsThe number of modified constants.
Returns
true if successful.

◆ GetConstantData() [1/2]

virtual void* Murl::Video::IConstantBuffer::GetConstantData ( )
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]

virtual const void* Murl::Video::IConstantBuffer::GetConstantData ( ) const
pure virtual

Get a constant pointer to the source data.

Returns
A pointer to the source data.

◆ GetConstantBufferData() [1/2]

virtual void* Murl::Video::IConstantBuffer::GetConstantBufferData ( )
pure virtual

Get a pointer to the actual mutable buffer data.

Returns
A pointer to the actual buffer data.

◆ GetConstantBufferData() [2/2]

virtual const void* Murl::Video::IConstantBuffer::GetConstantBufferData ( ) const
pure virtual

Get a pointer to the actual constant buffer data.

Returns
A pointer to the actual buffer data.

◆ GetMaxByteSize()

virtual UInt32 Murl::Video::IConstantBuffer::GetMaxByteSize ( ) const
pure virtual

Get the maximum number of bytes the buffer can hold.

Returns
The maximum buffer byte size.

◆ GetByteSize()

virtual UInt32 Murl::Video::IConstantBuffer::GetByteSize ( ) const
pure virtual

Get the actual number of buffer bytes used.

Returns
The actual buffer byte size.

◆ AreConstantsModified()

virtual Bool Murl::Video::IConstantBuffer::AreConstantsModified ( ) const
pure virtual

Check if the buffer contents are modified.

Returns
true if modified.

◆ AddUniform() [1/3]

virtual SInt32 Murl::Video::IConstantBuffer::AddUniform ( IEnums::UniformItem  item,
IEnums::UniformType  type,
UInt32 byteOffset 
)
pure virtual

Add a single predefined uniform variable.

Parameters
itemThe predefined item.
typeThe uniform data type.
byteOffsetThe 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]

virtual SInt32 Murl::Video::IConstantBuffer::AddUniform ( SInt32  id,
IEnums::UniformType  type,
UInt32 byteOffset 
)
pure virtual

Add a single custom uniform variable, by its unique integer ID in the renderer.

Parameters
idThe uniform's unique integer ID.
typeThe uniform data type.
byteOffsetThe 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]

virtual SInt32 Murl::Video::IConstantBuffer::AddUniform ( const String name,
IEnums::UniformType  type,
UInt32 byteOffset 
)
pure virtual

Add a single custom uniform variable, by its actual name.

Parameters
nameThe uniform variable name.
typeThe uniform data type.
byteOffsetThe 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()

virtual Bool Murl::Video::IConstantBuffer::RemoveAllUniforms ( )
pure virtual

Remove all present uniform variables from the buffer.

Returns
true if successful.

◆ GetUniformIndex() [1/3]

virtual SInt32 Murl::Video::IConstantBuffer::GetUniformIndex ( IEnums::UniformItem  item) const
pure virtual

Get the index of a predefined uniform variable in the buffer.

Parameters
itemThe uniform item to query.
Returns
The zero-based index of the uniform, or -1 if not found.

◆ GetUniformIndex() [2/3]

virtual SInt32 Murl::Video::IConstantBuffer::GetUniformIndex ( SInt32  id) const
pure virtual

Get the index of a custom uniform variable in the buffer, by its unique integer ID.

Parameters
idThe unique integer ID of the variable to query.
Returns
The zero-based index of the uniform, or -1 if not found.

◆ GetUniformIndex() [3/3]

virtual SInt32 Murl::Video::IConstantBuffer::GetUniformIndex ( const String name) const
pure virtual

Get the index of a custom uniform variable in the buffer, by its actual name.

Parameters
nameThe uniform variable name to query.
Returns
The zero-based index of the uniform, or -1 if not found.

◆ GetNumberOfUniforms()

virtual UInt32 Murl::Video::IConstantBuffer::GetNumberOfUniforms ( ) const
pure virtual

Get the total number of individual uniform variables present in the buffer.

Returns
The number of uniform variables present.

◆ GetUniformType()

virtual IEnums::UniformType Murl::Video::IConstantBuffer::GetUniformType ( UInt32  index) const
pure virtual

Get the data type of a uniform variable at a given index.

Parameters
indexThe 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()

virtual IEnums::UniformItem Murl::Video::IConstantBuffer::GetUniformItem ( UInt32  index) const
pure virtual

Get the predefined uniform variable item at a given index.

Parameters
indexThe 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()

virtual SInt32 Murl::Video::IConstantBuffer::GetUniformId ( UInt32  index) const
pure virtual

Get the unique integer ID of a uniform variable at a given index.

Parameters
indexThe 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()

virtual UInt32 Murl::Video::IConstantBuffer::GetUniformByteOffset ( UInt32  index) const
pure virtual

Get the byte offset of a uniform variable relative to the buffer start.

Parameters
indexThe 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()

virtual IUniform* Murl::Video::IConstantBuffer::GetUniform ( UInt32  index) const
pure virtual

Get the generic uniform variable at a given index.

Parameters
indexThe index of the variable to query, from 0 to GetNumberOfUniforms()-1.
Returns
The variable, or null if the index is out of range.

◆ GetFloatUniform()

virtual IFloatUniform* Murl::Video::IConstantBuffer::GetFloatUniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatUniform.

Parameters
indexThe 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()

virtual IFloatVector2Uniform* Murl::Video::IConstantBuffer::GetFloatVector2Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatVector2Uniform.

Parameters
indexThe 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()

virtual IFloatVector3Uniform* Murl::Video::IConstantBuffer::GetFloatVector3Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatVector3Uniform.

Parameters
indexThe 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()

virtual IFloatVector4Uniform* Murl::Video::IConstantBuffer::GetFloatVector4Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatVector4Uniform.

Parameters
indexThe 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()

virtual IFloatMatrix2Uniform* Murl::Video::IConstantBuffer::GetFloatMatrix2Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatMatrix2Uniform.

Parameters
indexThe 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()

virtual IFloatMatrix3Uniform* Murl::Video::IConstantBuffer::GetFloatMatrix3Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatMatrix3Uniform.

Parameters
indexThe 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()

virtual IFloatMatrix4Uniform* Murl::Video::IConstantBuffer::GetFloatMatrix4Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an IFloatMatrix4Uniform.

Parameters
indexThe 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()

virtual ISInt32Uniform* Murl::Video::IConstantBuffer::GetSInt32Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an ISInt32Uniform.

Parameters
indexThe 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()

virtual ISInt32Vector2Uniform* Murl::Video::IConstantBuffer::GetSInt32Vector2Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an ISInt32Vector2Uniform.

Parameters
indexThe 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()

virtual ISInt32Vector3Uniform* Murl::Video::IConstantBuffer::GetSInt32Vector3Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an ISInt32Vector3Uniform.

Parameters
indexThe 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()

virtual ISInt32Vector4Uniform* Murl::Video::IConstantBuffer::GetSInt32Vector4Uniform ( UInt32  index) const
pure virtual

Get the uniform variable at a given index as an ISInt32Vector4Uniform.

Parameters
indexThe 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()

virtual Bool Murl::Video::IConstantBuffer::IsEqual ( const IConstantBuffer other) const
pure virtual

Check if the constant buffer is equal to another one.

Parameters
otherThe buffer to compare with.
Returns
true if the buffers are equal.

◆ GetSignature()

virtual UInt32 Murl::Video::IConstantBuffer::GetSignature ( ) const
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


Copyright © 2011-2024 Spraylight GmbH.