"L. Spiro Engine"
Static Public Member Functions | Static Protected Attributes

lsg::CDirectX11CompiledShaderManager Class Reference

Manages the sharing of a single Direct3D 11 shader (vertex or pixel shader). More...

#include <LSGDirectX11CompiledShaderManager.h>

List of all members.

Static Public Member Functions

static LSVOID LSE_CALL SetSharing (LSBOOL _bVal)
static CCompiledShaderBase
*LSE_CALL 
CreateShader (const CString &_sShaderText, CShaderLanguageParser::LSG_SHADER_TYPES _stShaderType, CShaderTranslationProcessorBase::LSG_UNIFORM_LIST *_pulUniforms, CString &_sError)
static LSVOID LSE_CALL DeleteShader (CCompiledShaderBase *_pogcsShader)
static LSUINT32 LSE_CALL DeleteUnreferencedShaders ()

Static Protected Attributes

static LSBOOL m_bSharing
static CMap< CString,
CCompiledShaderBase * > 
m_mShaders [CShaderLanguageParser::LSG_ST_TOTAL]

Detailed Description

Manages the sharing of a single Direct3D 11 shader (vertex or pixel shader).

Class CDirectX11CompiledShaderManager Description: Manages the sharing of a single Direct3D 11 shader (vertex or pixel shader). Sharing is based off the (adjusted) shader text for the sake of speed. The alternative--sharing based off compiled code-- makes loading times too long. For debug purposes, sharing can be disabled.


Member Function Documentation

static CCompiledShaderBase* LSE_CALL lsg::CDirectX11CompiledShaderManager::CreateShader ( const CString &  _sShaderText,
CShaderLanguageParser::LSG_SHADER_TYPES  _stShaderType,
CShaderTranslationProcessorBase::LSG_UNIFORM_LIST _pulUniforms,
CString &  _sError 
) [static]

Create a new shader of a given type. The shader MUST be deleted using DeleteShader().

Parameters:
_sShaderTextThe shader text to compile. The syntax depends on the target graphics API.
_stShaderTypeThe shader type.
_pulUniformsShader uniforms.
_sErrorHolds returned errors.
Returns:
Returns a pointer to the new compiled shader on success, or NULL on failure.
static LSVOID LSE_CALL lsg::CDirectX11CompiledShaderManager::DeleteShader ( CCompiledShaderBase _pogcsShader) [static]

Delete a shader. If sharing, decreases its reference count. Otherwise deletes it from memory.

Parameters:
_pogcsShaderThe shader to delete.
static LSUINT32 LSE_CALL lsg::CDirectX11CompiledShaderManager::DeleteUnreferencedShaders ( ) [static]

Deletes all unreferenced shaders from memory. Returns the number of shaders NOT deleted.

Returns:
Returns the number of shaders NOT deleted.
static LSVOID LSE_CALL lsg::CDirectX11CompiledShaderManager::SetSharing ( LSBOOL  _bVal) [static]

Set sharing.

Parameters:
_bValIf true, sharing is enabled, otherwise not.

Member Data Documentation

Is sharing enabled? Defaults to true. Tools/editors should set this to false at program start.

CMap<CString, CCompiledShaderBase *> lsg::CDirectX11CompiledShaderManager::m_mShaders[CShaderLanguageParser::LSG_ST_TOTAL] [static, protected]

Map of shaders.


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