"L. Spiro Engine"
Classes | Public Member Functions | Protected Types | Protected Attributes

lsg::CDirectX11CompiledShader Class Reference

A base class for CDirectX11PixelShader and CDirectX11VertexShader which handles the common functionality between them. More...

#include <LSGDirectX11CompiledShader.h>

Inheritance diagram for lsg::CDirectX11CompiledShader:
lsg::CCompiledShaderBase lsg::CDirectX11PixelShader lsg::CDirectX11VertexShader

List of all members.

Classes

struct  LSG_CONSTANT_MAP
struct  LSG_CS_CBUFFER

Public Member Functions

virtual LSVOID LSE_CALL Reset ()
LSBOOL LSE_CALL SetUniforms (const CShaderTranslationProcessorBase::LSG_UNIFORM_LIST &_ulUniforms)
CShaderBase::LSG_HANDLE LSE_CALL GetConstantByName (const LSCHAR *_pcName)
LSBOOL LSE_CALL SetFloat (CShaderBase::LSG_HANDLE _hHandle, LSFLOAT _fValue)
LSBOOL LSE_CALL SetFloatArray (CShaderBase::LSG_HANDLE _hHandle, const LSFLOAT *_pfValues, LSUINT32 _ui32Total)
LSBOOL LSE_CALL SetInt (CShaderBase::LSG_HANDLE _hHandle, LSINT32 _iValue)
LSBOOL LSE_CALL SetIntArray (CShaderBase::LSG_HANDLE _hHandle, const LSINT32 *_piValues, LSUINT32 _ui32Total)
LSBOOL LSE_CALL SetBool (CShaderBase::LSG_HANDLE _hHandle, LSBOOL _bValue)
LSBOOL LSE_CALL SetBoolArray (CShaderBase::LSG_HANDLE _hHandle, const LSBOOL *_pbValues, LSUINT32 _ui32Total)
LSBOOL LSE_CALL SetVector2 (CShaderBase::LSG_HANDLE _hHandle, const CVector2 &_vValue)
LSBOOL LSE_CALL SetVector2Array (CShaderBase::LSG_HANDLE _hHandle, const CVector2 *_pvValues, LSUINT32 _ui32Total)
LSBOOL LSE_CALL SetVector3 (CShaderBase::LSG_HANDLE _hHandle, const CVector3 &_vValue)
LSBOOL LSE_CALL SetVector3Array (CShaderBase::LSG_HANDLE _hHandle, const CVector3 *_pvValues, LSUINT32 _ui32Total)
LSBOOL LSE_CALL SetVector4 (CShaderBase::LSG_HANDLE _hHandle, const CVector4 &_vValue)
LSBOOL LSE_CALL SetVector4Array (CShaderBase::LSG_HANDLE _hHandle, const CVector4 *_pvValues, LSUINT32 _ui32Total)
LSBOOL LSE_CALL SetMatrix2x2 (CShaderBase::LSG_HANDLE _hHandle, const CMatrix2x2 &_mValue)
LSBOOL LSE_CALL SetMatrix3x3 (CShaderBase::LSG_HANDLE _hHandle, const CMatrix3x3 &_mValue)
LSBOOL LSE_CALL SetMatrix4x4 (CShaderBase::LSG_HANDLE _hHandle, const CMatrix4x4 &_mValue)
LSBOOL LSE_CALL SetMatrix4x4Array (CShaderBase::LSG_HANDLE _hHandle, const CMatrix4x4 *_pmValues, LSUINT32 _ui32Total)
LSE_INLINE const void *LSE_CALL GetBufferPointer () const
LSE_INLINE SIZE_T LSE_CALL GetBufferSize () const

Protected Types

typedef struct
lsg::CDirectX11CompiledShader::LSG_CONSTANT_MAP
LPLSG_CONSTANT_MAP
typedef struct
lsg::CDirectX11CompiledShader::LSG_CONSTANT_MAP 
LPCLSG_CONSTANT_MAP
typedef struct
lsg::CDirectX11CompiledShader::LSG_CS_CBUFFER
LPLSG_CS_CBUFFER
typedef struct
lsg::CDirectX11CompiledShader::LSG_CS_CBUFFER 
LPCLSG_CS_CBUFFER

Protected Attributes

ID3DBlob * m_pbShader
CVectorPoD< ID3D11Buffer * > m_vConstantBuffers
CVector< LSG_CS_CBUFFERm_vConstBufferRawData
CShaderTranslationProcessorBase::LSG_UNIFORM_LIST m_ulUniforms
CVectorPoD< LSG_CONSTANT_MAPm_vConstantMap
CVectorPoD< LSUINT8, LSUINT32 > m_vTempBuffer

Detailed Description

A base class for CDirectX11PixelShader and CDirectX11VertexShader which handles the common functionality between them.

Class CDirectX11CompiledShader Description: A base class for CDirectX11PixelShader and CDirectX11VertexShader which handles the common functionality between them. Both classes have compiled code and a few constant buffers, and a way to convert handles from that constant table handle type to our custom handle type.


Member Typedef Documentation

Mapping of constant handles from the ID3DXConstantTable to our custom type.

A cbuffer. It is just an array of bytes and a dirty flag.


Member Function Documentation

LSE_INLINE const void *LSE_CALL lsg::CDirectX11CompiledShader::GetBufferPointer ( ) const

Gets the blob's signature.

Returns:
Returns a constant pointer to the blob data.
LSE_INLINE SIZE_T LSE_CALL lsg::CDirectX11CompiledShader::GetBufferSize ( ) const

Gets the blob's size.

Returns:
Returns the size of the blob data.
CShaderBase::LSG_HANDLE LSE_CALL lsg::CDirectX11CompiledShader::GetConstantByName ( const LSCHAR *  _pcName)

Get a handle for a uniform variable in the shader.

Parameters:
_pcNameName of the variable whose handle is to be obtained.
Returns:
Returns the handle to the given variable or ~0UL if the given name does not exist.
virtual LSVOID LSE_CALL lsg::CDirectX11CompiledShader::Reset ( ) [virtual]

Reset everything to scratch.

Reimplemented from lsg::CCompiledShaderBase.

Reimplemented in lsg::CDirectX11PixelShader, and lsg::CDirectX11VertexShader.

LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetBool ( CShaderBase::LSG_HANDLE  _hHandle,
LSBOOL  _bValue 
)

Set a single boolean value in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_bValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetBoolArray ( CShaderBase::LSG_HANDLE  _hHandle,
const LSBOOL *  _pbValues,
LSUINT32  _ui32Total 
)

Set an array of boolean values in the shader. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_piValuesNew values.
_ui32TotalTotal ints to set.
Returns:
Returns true if the values were set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetFloat ( CShaderBase::LSG_HANDLE  _hHandle,
LSFLOAT  _fValue 
)

Set a single scalar value in the shader of type float. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_fValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetFloatArray ( CShaderBase::LSG_HANDLE  _hHandle,
const LSFLOAT *  _pfValues,
LSUINT32  _ui32Total 
)

Set an array of scalar values in the shader of type float. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_pfValuesNew values.
_ui32TotalTotal floats to set.
Returns:
Returns true if the values were set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetInt ( CShaderBase::LSG_HANDLE  _hHandle,
LSINT32  _iValue 
)

Set a single scalar value in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_iValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetIntArray ( CShaderBase::LSG_HANDLE  _hHandle,
const LSINT32 *  _piValues,
LSUINT32  _ui32Total 
)

Set an array of scalar values in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_piValuesNew values.
_ui32TotalTotal ints to set.
Returns:
Returns true if the values were set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetMatrix2x2 ( CShaderBase::LSG_HANDLE  _hHandle,
const CMatrix2x2 &  _mValue 
)

Set a 2-by-2 matrix in a shader. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_mValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetMatrix3x3 ( CShaderBase::LSG_HANDLE  _hHandle,
const CMatrix3x3 &  _mValue 
)

Set a 3-by-3 matrix in a shader. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_mValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetMatrix4x4 ( CShaderBase::LSG_HANDLE  _hHandle,
const CMatrix4x4 &  _mValue 
)

Set a 4-by-4 matrix in a shader. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_mValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetMatrix4x4Array ( CShaderBase::LSG_HANDLE  _hHandle,
const CMatrix4x4 *  _pmValues,
LSUINT32  _ui32Total 
)

Set an array of 4-by-4 matrices in a shader. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_pmValuesNew values.
_ui32TotalTotal ints to set.
Returns:
Returns true if the values were set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetUniforms ( const CShaderTranslationProcessorBase::LSG_UNIFORM_LIST _ulUniforms)

Set the uniforms associated with this shader.

Parameters:
_ulUniformsThe uniforms to copy to this shader.
Returns:
Returns true if there is enough memory to copy the list of uniforms.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetVector2 ( CShaderBase::LSG_HANDLE  _hHandle,
const CVector2 &  _vValue 
)

Set a 2-dimensional vector in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_vValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetVector2Array ( CShaderBase::LSG_HANDLE  _hHandle,
const CVector2 *  _pvValues,
LSUINT32  _ui32Total 
)

Set a 2-dimensional vector array in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_vValueNew values.
_ui32TotalTotal ints to set.
Returns:
Returns true if the values were set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetVector3 ( CShaderBase::LSG_HANDLE  _hHandle,
const CVector3 &  _vValue 
)

Set a 3-dimensional vector in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_vValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetVector3Array ( CShaderBase::LSG_HANDLE  _hHandle,
const CVector3 *  _pvValues,
LSUINT32  _ui32Total 
)

Set a 3-dimensional vector array in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_vValueNew values.
_ui32TotalTotal ints to set.
Returns:
Returns true if the values were set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetVector4 ( CShaderBase::LSG_HANDLE  _hHandle,
const CVector4 &  _vValue 
)

Set a 4-dimensional vector in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_vValueNew value.
Returns:
Returns true if the value was set in the shader.
LSBOOL LSE_CALL lsg::CDirectX11CompiledShader::SetVector4Array ( CShaderBase::LSG_HANDLE  _hHandle,
const CVector4 *  _pvValues,
LSUINT32  _ui32Total 
)

Set a 4-dimensional vector array in the shader of type int. Shader must be active.

Parameters:
_hHandleHandle to the value to set in the shader.
_vValueNew values.
_ui32TotalTotal ints to set.
Returns:
Returns true if the values were set in the shader.

Member Data Documentation

The compiled shader.

Uniform globals in the shaders.

CVectorPoD<ID3D11Buffer *> lsg::CDirectX11CompiledShader::m_vConstantBuffers [protected]

Constant tables, one for each cbuffer.

Map of constants and their handles/other data related to them.

Array of cbuffers.

CVectorPoD<LSUINT8, LSUINT32> lsg::CDirectX11CompiledShader::m_vTempBuffer [protected]

Temporary buffer.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator