Torque3D Documentation / _generateds / GFXShaderConstBuffer

GFXShaderConstBuffer

Engine/source/gfx/gfxShader.h

GFXShaderConstBuffer is a collection of shader data which are sent to the device in one call in most cases.

More...

Protected Attributes

bool

The lost state of the buffer content.

Public Attributes

Protected Functions

Public Functions

Return the shader that created this buffer.

Set a shader constant.

Set a variable sized matrix shader constant.

set(GFXShaderConstHandle * handle, const MatrixF * mat, const U32 arraySize, const GFXShaderConstType matrixType)

Set a variable sized matrix shader constant from an array of matricies.

setSafe(GFXShaderConstHandle * handle, const VALUE & v)

An inline helper which ensures the handle is valid before the virtual set method is called.

bool

The content of the buffer is in the lost state when first created or when the shader is reloaded.

Detailed Description

GFXShaderConstBuffer is a collection of shader data which are sent to the device in one call in most cases.

The content of the buffer is persistant and if a value does not change frequently there is a savings in not setting the value every frame.

Protected Attributes

bool mWasLost 

The lost state of the buffer content.

Derived classes need to set the lost state on first creation of the buffer and shader reloads.

Public Attributes

U8 * mInstPtr 

Protected Functions

GFXShaderConstBuffer()

Public Functions

getShader()

Return the shader that created this buffer.

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< F32 > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< Point2F > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< Point2I > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< Point3F > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< Point3I > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< Point4F > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< Point4I > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const AlignedArray< S32 > & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const F32 f)

Set a shader constant.

The constant handle is assumed to be valid.

Perfer using setSafe unless you can check the handle validity yourself and skip a significat amount of work.

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const LinearColorF & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const MatrixF & mat, const GFXShaderConstType matrixType)

Set a variable sized matrix shader constant.

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const MatrixF * mat, const U32 arraySize, const GFXShaderConstType matrixType)

Set a variable sized matrix shader constant from an array of matricies.


Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const PlaneF & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const Point2F & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const Point2I & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const Point3F & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const Point3I & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const Point4F & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const Point4I & fv)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

set(GFXShaderConstHandle * handle, const S32 f)

Reimplemented by: GFXD3D11ShaderConstBuffer, GFXGLShaderConstBuffer

setSafe(GFXShaderConstHandle * handle, const VALUE & v)

An inline helper which ensures the handle is valid before the virtual set method is called.

You should prefer using this method unless your sure the handle is always valid or if your doing your own test.

wasLost()

The content of the buffer is in the lost state when first created or when the shader is reloaded.

When the content is lost you must refill the buffer with all the constants used by your shader.

Use this property to avoid setting constants which do not changefrom one frame to the next.