GFXD3D11ShaderConstBuffer
Engine/source/gfx/D3D11/gfxD3D11Shader.h
The D3D11 implementation of a shader constant buffer.
Public Friends
class
Private Attributes
ID3D11DeviceContext *
Protected Attributes
ID3D11Buffer *
mConstantBuffersP [CBUFFER_MAX]
ID3D11Buffer *
mConstantBuffersV [CBUFFER_MAX]
We keep a weak reference to the shader because it will often be deleted.
Public Functions
GFXD3D11ShaderConstBuffer(GFXD3D11Shader * shader, GFXD3D11ConstBufferLayout * vertexLayout, GFXD3D11ConstBufferLayout * pixelLayout)
activate(GFXD3D11ShaderConstBuffer * prevShaderBuffer)
Called by GFXD3D11Device to activate this buffer.
The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.
bool
isDirty()
Used internally by GXD3D11ShaderConstBuffer to determine if it's dirty.
onShaderReload(GFXD3D11Shader * shader)
Called from GFXD3D11Shader when constants have changed and need to be the shader this buffer references is reloaded.
set(GFXShaderConstHandle * handle, const AlignedArray< F32 > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< Point2F > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< Point2I > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< Point3F > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< Point3I > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< Point4F > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< Point4I > & fv)
set(GFXShaderConstHandle * handle, const AlignedArray< S32 > & fv)
set(GFXShaderConstHandle * handle, const F32 f)
Set a shader constant.
set(GFXShaderConstHandle * handle, const LinearColorF & fv)
set(GFXShaderConstHandle * handle, const MatrixF & mat, const GFXShaderConstType matrixType)
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.
set(GFXShaderConstHandle * handle, const PlaneF & fv)
set(GFXShaderConstHandle * handle, const Point2F & fv)
set(GFXShaderConstHandle * handle, const Point2I & fv)
set(GFXShaderConstHandle * handle, const Point3F & fv)
set(GFXShaderConstHandle * handle, const Point3I & fv)
set(GFXShaderConstHandle * handle, const Point4F & fv)
set(GFXShaderConstHandle * handle, const Point4I & fv)
set(GFXShaderConstHandle * handle, const S32 f)
Protected Functions
SET_CONSTANT(GFXShaderConstHandle * handle, const T & fv, GenericConstBuffer * vBuffer, GenericConstBuffer * pBuffer)
Detailed Description
The D3D11 implementation of a shader constant buffer.
Public Friends
Private Attributes
ID3D11DeviceContext * mDeviceContext
Protected Attributes
ID3D11Buffer * mConstantBuffersP [CBUFFER_MAX]
ID3D11Buffer * mConstantBuffersV [CBUFFER_MAX]
GenericConstBuffer * mPixelConstBuffer
GFXD3D11ConstBufferLayout * mPixelConstBufferLayout
WeakRefPtr< GFXD3D11Shader > mShader
We keep a weak reference to the shader because it will often be deleted.
GenericConstBuffer * mVertexConstBuffer
GFXD3D11ConstBufferLayout * mVertexConstBufferLayout
Public Functions
GFXD3D11ShaderConstBuffer(GFXD3D11Shader * shader, GFXD3D11ConstBufferLayout * vertexLayout, GFXD3D11ConstBufferLayout * pixelLayout)
~GFXD3D11ShaderConstBuffer()
activate(GFXD3D11ShaderConstBuffer * prevShaderBuffer)
Called by GFXD3D11Device to activate this buffer.
Parameters:
mPrevShaderBuffer | The previously active buffer |
describeSelf()
Reimplemented from: GFXResource
getShader()
Reimplemented from: GFXShaderConstBuffer
isDirty()
Used internally by GXD3D11ShaderConstBuffer to determine if it's dirty.
onShaderReload(GFXD3D11Shader * shader)
Called from GFXD3D11Shader when constants have changed and need to be the shader this buffer references is reloaded.
resurrect()
Reimplemented from: GFXResource
set(GFXShaderConstHandle * handle, const AlignedArray< F32 > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< Point2F > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< Point2I > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< Point3F > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< Point3I > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< Point4F > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< Point4I > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const AlignedArray< S32 > & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const F32 f)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const LinearColorF & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const MatrixF & mat, const GFXShaderConstType matrixType)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const MatrixF * mat, const U32 arraySize, const GFXShaderConstType matrixType)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const PlaneF & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const Point2F & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const Point2I & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const Point3F & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const Point3I & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const Point4F & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const Point4I & fv)
Reimplemented from: GFXShaderConstBuffer
set(GFXShaderConstHandle * handle, const S32 f)
Reimplemented from: GFXShaderConstBuffer
zombify()
Reimplemented from: GFXResource
Protected Functions
_createBuffers()
SET_CONSTANT(GFXShaderConstHandle * handle, const T & fv, GenericConstBuffer * vBuffer, GenericConstBuffer * pBuffer)