Torque3D Documentation / _generateds / GenericConstBuffer

GenericConstBuffer

Engine/source/gfx/genericConstBuffer.h

This class manages shader constant data in a system memory buffer.

More...

Set shader constant values

Actually set shader constant values

Parameters:

name

Name of the constant, this should be a name contained in the array returned in getShaderConstDesc, if an invalid name is used, its ignored, but it's not an error.

getDirtyBuffer(U32 * start, U32 * size)

Gets the dirty buffer range and clears the dirty state at the same time.

Gets the entire buffer ignoring dirty range.

setDirty(bool dirty)

Sets the entire buffer as dirty or clears the dirty state.

bool

Returns true if the buffer has been modified since the last call to getDirtyBuffer or setDirty.

bool

Returns true if have the same layout and hold the same data as the input buffer.

Returns our layout object.

Returns a pointer to the raw buffer.

Called by the inlined set functions above to do the real dirty work of copying the data to the right location within the buffer.

The buffer layout.

U8 *

The pointer to the contant store or NULL if the layout is empty.

The byte offset to the start of the dirty range within the buffer or U32_MAX if the buffer is not dirty.

The btye offset to the end of the dirty range within the buffer or 0 if the buffer is not dirty.

Detailed Description

This class manages shader constant data in a system memory buffer.

It is used by device specific classes for batching together many constant changes which are then copied to the device thru a single API call.

Set shader constant values

Actually set shader constant values

Parameters:

name

Name of the constant, this should be a name contained in the array returned in getShaderConstDesc, if an invalid name is used, its ignored, but it's not an error.

set(const GenericConstBufferLayout::ParamDesc & pd, const F32 f)

set(const GenericConstBufferLayout::ParamDesc & pd, const Point2F & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const Point3F & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const Point4F & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const PlaneF & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const LinearColorF & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const S32 f)

set(const GenericConstBufferLayout::ParamDesc & pd, const Point2I & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const Point3I & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const Point4I & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< F32 > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< Point2F > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< Point3F > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< Point4F > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< S32 > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< Point2I > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< Point3I > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const AlignedArray< Point4I > & fv)

set(const GenericConstBufferLayout::ParamDesc & pd, const MatrixF & mat, const GFXShaderConstType matrixType)

set(const GenericConstBufferLayout::ParamDesc & pd, const MatrixF * mat, const U32 arraySize, const GFXShaderConstType matrixType)

getDirtyBuffer(U32 * start, U32 * size)

Gets the dirty buffer range and clears the dirty state at the same time.

getEntireBuffer()

Gets the entire buffer ignoring dirty range.

setDirty(bool dirty)

Sets the entire buffer as dirty or clears the dirty state.

isDirty()

Returns true if the buffer has been modified since the last call to getDirtyBuffer or setDirty.

The buffer is not dirty on initial creation.

isEqual(const GenericConstBuffer * buffer)

Returns true if have the same layout and hold the same data as the input buffer.

getLayout()

Returns our layout object.

getBuffer()

Returns a pointer to the raw buffer.

internalSet(const GenericConstBufferLayout::ParamDesc & pd, const GFXShaderConstType constType, const U32 size, const void * data)

Called by the inlined set functions above to do the real dirty work of copying the data to the right location within the buffer.

GenericConstBufferLayout * mLayout 

The buffer layout.

U8 * mBuffer 

The pointer to the contant store or NULL if the layout is empty.

U32 mDirtyStart 

The byte offset to the start of the dirty range within the buffer or U32_MAX if the buffer is not dirty.

U32 mDirtyEnd 

The btye offset to the end of the dirty range within the buffer or 0 if the buffer is not dirty.