GFXD3D9Shader Class Reference

#include <gfxD3D9Shader.h>

Inheritance diagram for GFXD3D9Shader:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GFXD3D9Shader ()
virtual ~GFXD3D9Shader ()
virtual bool init (const Torque::Path &vertFile, const Torque::Path &pixFile, F32 pixVersion, const Vector< GFXShaderMacro > &macros)
GFXShader interface
virtual GFXShaderConstBufferRef allocConstBuffer ()
 Allocate a constant buffer.
virtual const Vector< GFXShaderConstDesc > & getShaderConstDesc () const
 Returns our list of shader constants, the material can get this and just set the constants it knows about.
virtual GFXShaderConstHandlegetShaderConstHandle (const String &name)
 Returns a shader constant handle for name, if the variable doesn't exist NULL is returned.
virtual U32 getAlignmentValue (const GFXShaderConstType constType) const
 Returns the alignment value for constType.
virtual void process ()
 Set this as the active shader.
GFXResource interface
virtual void zombify ()
 When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.
virtual void resurrect ()
 When called the resource should restore all device sensitive information destroyed by zombify().

Protected Member Functions

virtual void _compileShader (const Torque::Path &filePath, const String &target, const D3DXMACRO *defines, GenericConstBufferLayout *bufferLayoutF, GenericConstBufferLayout *bufferLayoutI)
void _getShaderConstants (ID3DXConstantTable *table, GenericConstBufferLayout *bufferLayoutF, GenericConstBufferLayout *bufferLayoutI)
bool _saveCompiledOutput (const Torque::Path &filePath, LPD3DXBUFFER buffer, GenericConstBufferLayout *bufferLayoutF, GenericConstBufferLayout *bufferLayoutI)
bool _loadCompiledOutput (const Torque::Path &filePath, const String &target, GenericConstBufferLayout *bufferLayoutF, GenericConstBufferLayout *bufferLayoutI)
void _buildShaderConstantHandles (GenericConstBufferLayout *layout, bool vertexConst)

Protected Attributes

LPDIRECT3DDEVICE9 mD3D9Device
IDirect3DVertexShader9 * mVertShader
IDirect3DPixelShader9 * mPixShader
GFXD3D9ShaderBufferLayout * mVertexConstBufferLayoutF
GFXD3D9ShaderBufferLayout * mPixelConstBufferLayoutF
GFXD3D9ShaderBufferLayout * mVertexConstBufferLayoutI
GFXD3D9ShaderBufferLayout * mPixelConstBufferLayoutI
HandleMap mHandles
Vector< GFXShaderConstDescmShaderConsts
 Vector of descriptions (consolidated for the getShaderConstDesc call).

Static Protected Attributes

static const U32 smCompiledShaderTag
static _gfxD3DXIncludeRef smD3DXInclude

Friends

class GFXD3D9Device
class GFX360Device
class GFXD3D9ShaderConstBuffer

Constructor & Destructor Documentation

GFXD3D9Shader::GFXD3D9Shader (  ) 

virtual GFXD3D9Shader::~GFXD3D9Shader (  )  [virtual]


Member Function Documentation

virtual bool GFXD3D9Shader::init ( const Torque::Path vertFile,
const Torque::Path pixFile,
F32  pixVersion,
const Vector< GFXShaderMacro > &  macros 
) [virtual]

Implements GFXShader.

virtual GFXShaderConstBufferRef GFXD3D9Shader::allocConstBuffer (  )  [virtual]

Allocate a constant buffer.

Implements GFXShader.

virtual const Vector<GFXShaderConstDesc>& GFXD3D9Shader::getShaderConstDesc (  )  const [virtual]

Returns our list of shader constants, the material can get this and just set the constants it knows about.

Implements GFXShader.

virtual GFXShaderConstHandle* GFXD3D9Shader::getShaderConstHandle ( const String name  )  [virtual]

Returns a shader constant handle for name, if the variable doesn't exist NULL is returned.

Implements GFXShader.

virtual U32 GFXD3D9Shader::getAlignmentValue ( const GFXShaderConstType  constType  )  const [virtual]

Returns the alignment value for constType.

Implements GFXShader.

virtual void GFXD3D9Shader::process (  )  [virtual]

Set this as the active shader.

Reimplemented from GFXShader.

virtual void GFXD3D9Shader::zombify (  )  [virtual]

When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.

Implements GFXResource.

virtual void GFXD3D9Shader::resurrect (  )  [virtual]

When called the resource should restore all device sensitive information destroyed by zombify().

Implements GFXResource.

virtual void GFXD3D9Shader::_compileShader ( const Torque::Path filePath,
const String target,
const D3DXMACRO *  defines,
GenericConstBufferLayout bufferLayoutF,
GenericConstBufferLayout bufferLayoutI 
) [protected, virtual]

void GFXD3D9Shader::_getShaderConstants ( ID3DXConstantTable *  table,
GenericConstBufferLayout bufferLayoutF,
GenericConstBufferLayout bufferLayoutI 
) [protected]

bool GFXD3D9Shader::_saveCompiledOutput ( const Torque::Path filePath,
LPD3DXBUFFER  buffer,
GenericConstBufferLayout bufferLayoutF,
GenericConstBufferLayout bufferLayoutI 
) [protected]

bool GFXD3D9Shader::_loadCompiledOutput ( const Torque::Path filePath,
const String target,
GenericConstBufferLayout bufferLayoutF,
GenericConstBufferLayout bufferLayoutI 
) [protected]

void GFXD3D9Shader::_buildShaderConstantHandles ( GenericConstBufferLayout layout,
bool  vertexConst 
) [protected]


Friends And Related Function Documentation

friend class GFXD3D9Device [friend]

friend class GFX360Device [friend]

friend class GFXD3D9ShaderConstBuffer [friend]


Member Data Documentation

const U32 GFXD3D9Shader::smCompiledShaderTag [static, protected]

LPDIRECT3DDEVICE9 GFXD3D9Shader::mD3D9Device [protected]

IDirect3DVertexShader9* GFXD3D9Shader::mVertShader [protected]

IDirect3DPixelShader9* GFXD3D9Shader::mPixShader [protected]

GFXD3D9ShaderBufferLayout* GFXD3D9Shader::mVertexConstBufferLayoutF [protected]

GFXD3D9ShaderBufferLayout* GFXD3D9Shader::mPixelConstBufferLayoutF [protected]

GFXD3D9ShaderBufferLayout* GFXD3D9Shader::mVertexConstBufferLayoutI [protected]

GFXD3D9ShaderBufferLayout* GFXD3D9Shader::mPixelConstBufferLayoutI [protected]

Vector of descriptions (consolidated for the getShaderConstDesc call).