Shader Program Buffer/PlayStation 3

From Burnout Wiki
Hmmm...
Hmmm...
To do:
This page is incomplete. I may return to it in the future. The parent page will do for now. -burninrubber0

Structures

renderengine::ProgramBuffer

Offset Length Type Name Description Comments
0x0 0x4 void* m_programBuffer Set at runtime?
Sometimes filled with seemingly garbage bytes
0x4 0x4 uint32_t m_programSize Always 0. Set at runtime?
0x8 0x4 uint32_t m_programOffset Always 0. Set at runtime?
0xC 0x4 Type m_programType Shader type Pixel or vertex shader
0x10 0x4 uint32_t m_programFlags Flags See flags
0x14 0x4 CGprogram m_cgProgramBuffer
0x18 0x4 uint32_t m_cgProgramSize
0x1C 0x4 uint32_t m_numParameters Number of parameters
0x20 0x4 ParameterOffsetTable* m_parameterOffsetTable Parameter offset table nullptr if vertex shader

Immediately followed by a set of ProgramVariableDescriptor entries of an amount defined by m_numParameters.

_CGprogram

No associated symbols.

Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? Flag behaviour changes when 0x1B5C
0x4 0x4 uint32_t ?
0x8 0x4 uint32_t ? Size Same value as m_cgProgramSize in ProgramBuffer
0xC 0x4 uint32_t ? Number of entries pointed to by 0x10
0x10 0x4 ?* ? Unknown 0 Relative to CGprogram start
See unknown 0
0x14 0x4 uint32_t ? Size of unknown 0
0x18 0x4 uint32_t ? Size of unknown 1
0x1C 0x4 ?* ? Unknown 1 Relative to CGprogram start
See unknown 1

renderengine::shaderpatch::ParameterOffsetTable

Offset Length Type Name Description Comments
0x0 0x4 uint32_t m_numParameters
0x4 0x4 uint32_t m_size

This structure is immediately followed by a set of unknown structures of count m_numParameters:

Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? Type? 1 or 2 in samples
0 if field at 0x8 is null
0x4 0x4 uint32_t ? 0 in samples
0x8 0x4 uint32_t* ? Number of ? Offset relative to ParameterOffsetTable start

There may be further data that is always null, but it is more likely the size is aligned 0x80.

renderengine::ProgramBuffer::ProgramVariableDescriptor

Offset Length Type Name Description Comments
0x0 0x2 uint16_t m_index
0x2 0x2 uint16_t m_numConstants
0x4 0x2 uint16_t m_dataType
0x6 0x2 uint16_t m_cgParamIndex

Unknown 0

Offset Length Type Name Description Comments
0x0 0x4 uint32_t ?
0x4 0x4 uint32_t ?
0x8 0x4 uint32_t ? 0x1005 or 0x1006 in samples
0xC 0x4 int32_t ? -1 in samples
0x10 0x4 uint32_t ? Name 1? Points to a string in the following data
0x14 0x4 uint32_t ? Points to an unknown data structure (vertices?) in the following data
0x18 0x4 uint32_t ? Points to an unknown data structure (indices?) in the following data
0x1C 0x4 uint32_t ? Name 2? Points to a string in the following data
0x20 0x4 uint32_t ?
0x24 0x4 int32_t ? 0 or -1 in samples
0x28 0x4 uint32_t ? 1 in samples
0x2C 0x4 ? ? 0 in samples

Unknown 1

Hmmm...
Hmmm...
To do:
Define this structure.

Typedefs

CGprogram

Name Type Length Comments
CGprogram _CGprogram Example

Enumerations

renderengine::ProgramBuffer::Type

Name Value Comments
TYPE_NA 0
TYPE_VERTEX 1
TYPE_PIXEL 2
TYPE_FORCEENUMSIZEINT 0x7FFFFFFF

Flags

Name Value Comments
FLAG_PS3PATCHABLE 0x1 Initialize the parameter offset table
Set on pixel shaders, unset on vertex shaders