Shader Technique/PlayStation 3

From Burnout Wiki

Structures[edit | edit source]

CgsGraphics::ShaderTechnique[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 ProgramBuffer* mpVertexProgramBuffer nullptr in asset
0x4 0x4 ProgramBuffer* mpPixelProgramBuffer nullptr in asset
0x8 0x14 ShaderConstantsInternal mInternalVertexShaderConstants
0x1C 0x10 ShaderConstantsExternal mExternalObjectVertexShaderConstants
0x2C 0x10 ShaderConstantsExternal mExternalGlobalVertexShaderConstants
0x3C 0x14 ShaderConstantsInternal mInternalPixelShaderConstants
0x50 0x10 ShaderConstantsExternal mExternalObjectPixelShaderConstants
0x60 0x10 ShaderConstantsExternal mExternalGlobalPixelShaderConstants
0x70 0x10 ShaderConstantsCPU mCPUShaderConstants Unused?
0x80 0xC ShaderConstantHashTable mShaderConstantHashTable
0x8C 0x4 ShaderSampler* mpaSamplers
0x90 0x1 int8_t miNumSamplers
0x91 0x3 Padding
0x94 0x4 char* mpacName

ShaderConstantsInternal[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 uint32_t muNumConstantsInstances Number of instances Applies to size, data and hashes
0x4 0x4 uint32_t* mpauConstantsInstanceSize Per-instance data size
0x8 0x4 uint32_t** mppaConstantsInstanceData Instance data Instance data is actually float[4]
0xC 0x4 uint32_t* mpauNamesHash Array of hashes of the names of constants CRC32?
0x10 0x4 ProgramVariableHandle* mpaProgramStateHandles

renderengine::ProgramVariableHandle[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 ProgramBuffer* m_programBuffer nullptr in asset
0x4 0x2 uint16_t m_index
0x6 0x1 uint8_t m_numConstants If 4, all floats in instance data used?
0x7 0x1 uint8_t m_dataFlags See flags. Lower 3 bits form the data type.

ShaderConstantsExternal[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 uint32_t muNumConstantsInstances Number of instances Applies to data and names
0x4 0x4 uint32_t* mppaConstantsInstanceData Instance data
0x8 0x4 char** mppacNames Names of constants 16 bytes reserved for chars
0xC 0x4 ProgramVariableHandle* mpaProgramStateHandles Can be padding

ShaderConstantsCPU[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 ICPUShader* mpCPUShader nullptr in asset
0x4 0x4 uint32_t muNumConstantsInstances
0x8 0x4 uint32_t** mppaConstantsInstanceData
0xC 0x4 char** mppacNames

CgsGraphics::ShaderConstantHashTable[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 uint32_t* mpuHashKeys Constant names hashed CRC32?
0x4 0x4 char** mppcNames
0x8 0x4 uint32_t muSize Number of entries

CgsGraphics::ShaderSampler[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x4 char* mpacName Sampler name
0x4 0x2 int16_t miChannel
0x6 0x2 Padding

Enumerations[edit | edit source]

Handle flags[edit | edit source]

Name Value Comments
FLAGS_FLOAT 0x1 Data type flag
FLAGS_SAMPLER 0x2 Data type flag
FLAGS_BOOL 0x4 Data type flag
FLAGS_VERTEXPROGRAM 0x80