GFXD3D9Shader

Engine/source/gfx/D3D9/gfxD3D9Shader.h

The D3D9 implementation of a shader.

More...

Public Types

Protected Attributes

IDirect3DDevice9 *

The shader disassembly from DX when this shader is compiled.

IDirect3DPixelShader9 *

Vector of sampler type descriptions consolidated from _compileShader.

Vector of descriptions (consolidated for the getShaderConstDesc call)

IDirect3DVertexShader9 *

Public Functions

Allocate a constant buffer.

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

Returns the alignment value for constType.

bool

Device specific shaders can override this method to return the shader disassembly.

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

Returns a shader constant handle for name.

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

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

Protected Functions

Used to build the instancing shader constants from the instancing vertex format.

bool
_compileShader(const Torque::Path & filePath, const String & target, const _D3DXMACRO * defines, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)
_getShaderConstants(ID3DXConstantTable * table, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)
bool

Internal initialization function overloaded for each GFX device type.

bool
_loadCompiledOutput(const Torque::Path & filePath, const String & target, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)
bool
_saveCompiledOutput(const Torque::Path & filePath, ID3DXBuffer * buffer, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)

Detailed Description

The D3D9 implementation of a shader.

Public Types

typedef Map< String, GFXD3D9ShaderConstHandle * > HandleMap 

Public Friends

Protected Static Attributes

const U32 smCompiledShaderTag 
_gfxD3DXIncludeRef smD3DXInclude 

Protected Attributes

IDirect3DDevice9 * mD3D9Device 
String mDissasembly 

The shader disassembly from DX when this shader is compiled.

We only store this data in non-release builds.

HandleMap mHandles 
GFXD3D9ShaderBufferLayout * mPixelConstBufferLayoutF 
GFXD3D9ShaderBufferLayout * mPixelConstBufferLayoutI 
IDirect3DPixelShader9 * mPixShader 
Vector< GFXShaderConstDesc > mSamplerDescriptions 

Vector of sampler type descriptions consolidated from _compileShader.

Vector< GFXShaderConstDesc > mShaderConsts 

Vector of descriptions (consolidated for the getShaderConstDesc call)

GFXD3D9ShaderBufferLayout * mVertexConstBufferLayoutF 
GFXD3D9ShaderBufferLayout * mVertexConstBufferLayoutI 
IDirect3DVertexShader9 * mVertShader 

Public Functions

GFXD3D9Shader()

~GFXD3D9Shader()

allocConstBuffer()

Reimplemented from: GFXShader

findShaderConstHandle(const String & name)

Reimplemented from: GFXShader

getAlignmentValue(const GFXShaderConstType constType)

Reimplemented from: GFXShader

getDisassembly(String & outStr)

Reimplemented from: GFXShader

getShaderConstDesc()

Reimplemented from: GFXShader

getShaderConstHandle(const String & name)

Reimplemented from: GFXShader

resurrect()

Reimplemented from: GFXResource

zombify()

Reimplemented from: GFXResource

Protected Functions

_buildInstancingShaderConstantHandles()

Used to build the instancing shader constants from the instancing vertex format.

_buildSamplerShaderConstantHandles(Vector< GFXShaderConstDesc > & samplerDescriptions)

_buildShaderConstantHandles(GenericConstBufferLayout * layout, bool vertexConst)

_compileShader(const Torque::Path & filePath, const String & target, const _D3DXMACRO * defines, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)

_getShaderConstants(ID3DXConstantTable * table, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)

_init()

Reimplemented from: GFXShader

_loadCompiledOutput(const Torque::Path & filePath, const String & target, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)

_saveCompiledOutput(const Torque::Path & filePath, ID3DXBuffer * buffer, GenericConstBufferLayout * bufferLayoutF, GenericConstBufferLayout * bufferLayoutI, Vector< GFXShaderConstDesc > & samplerDescriptions)