Texture/PlayStation 3

From Burnout Wiki

Structures[edit | edit source]

The majority of this information is from the SCE PS3 SDK: CellGcmTexture datatype reference, though Burnout's debugging symbols were also referenced.

renderengine::Texture[edit | edit source]

Offset Length Type Name Description Comments
0x0 0x1 uint8_t m_format Texture format See format
0x1 0x1 uint8_t m_mipmap Number of mipmap levels (1-13) Sum of the maximum number of mipmap levels for the texture + 1
0x2 0x1 uint8_t m_dimension Texture dimension See dimension
0x3 0x1 uint8_t m_cubemap Enable or disable cube mapping See CubeMapEnable
0x4 0x4 uint32_t m_remap Method of selecting each element of the color value See remap
0x8 0x2 uint16_t m_width Width of texture (1-4096)
0xA 0x2 uint16_t m_height Height of texture (1-4096)
0xC 0x2 uint16_t m_depth Depth of texture (1-512) Always 1 in Burnout as 3D textures are not used
0xE 0x1 uint8_t m_location Location of texture data (main memory or local memory) See location
0xF 0x1 uint8_t m_padding
0x10 0x4 uint32_t m_pitch Pitch size of texture See pitch
0x14 0x4 uint32_t m_offset Offset value from the base address of the texture data location
0x18 0x4 void * m_buffer Texture
0x1C 0x4 Type m_storeType Store type
0x20 0x4 uint32_t m_storeFlags Store flags Seemingly unused

Format[edit | edit source]

Swizzling and normalization is not used in Burnout, so these flags are unused.

Below is the bitwise structure for the format field.

Offset (bits) Length (bits) Name Description Comments
0 1 Unused, always 1
1 1 Normalization flag See normalization flag
2 1 Swizzle flag See swizzle flag
3 5 Color format See color format

For example, the following is the DXT5 format as found in Burnout:

Format 0x88
Bit value 1 0 0 0 1 0 0 0
Parsed value 1 0 0 8

Remap[edit | edit source]

The remap order is only used when one of the following color formats is specified:


These are not used in Burnout, so the remap field is unused.

Below is the bitwise structure for the remap field. It is unclear whether this is in MSB 0 or LSB 0 notation.

Offset (bits) Length (bits) Name Description Comments
0 16 Remap order
16 2 Output blue element
18 2 Output green element
20 2 Output red element
22 2 Output alpha element
24 2 Input blue element
26 2 Input green element
28 2 Input red element
30 2 Input alpha element

Pitch[edit | edit source]

Pitch is the texture width multiplied by the bytes per texel. It must be specified when using linear texture formats or DXT compression. If the texture is swizzled or the DXT texture width is a power of 2, pitch is ignored. Otherwise, it must be 16 or more.

Burnout only uses textures with widths at powers of 2, so pitch is unused. However, if it becomes necessary to calculate pitch, the following formula may be used for DXT textures:

pitch = floor((width+3)/4)* block_size

Where block_size is 8 for DXT1 and 16 for DXT2 through DXT5.

Enumerations[edit | edit source]

Much of this information is from the SCE PS3 SDK: GCM Method Macros Overview, section 6.4: TextureFormat. Some information is also from the CellGcmTexture datatype documentation. Various other sources are used.

Color format[edit | edit source]

Name Value Comments
CELL_GCM_TEXTURE_B8 0x81 One 8-bit unsigned integer
CELL_GCM_TEXTURE_A1R5G5B5 0x82 One 1-bit value and three unsigned 5-bit integers
CELL_GCM_TEXTURE_A4R4G4B4 0x83 Four unsigned 4-bit values
CELL_GCM_TEXTURE_R5G6B5 0x84 5-bit, 6-bit, and 5-bit unsigned integers
CELL_GCM_TEXTURE_A8R8G8B8 0x85 Four 8-bit unsigned integers
CELL_GCM_TEXTURE_COMPRESSED_DXT1 0x86 4x4 pixels compressed to 8 bytes
CELL_GCM_TEXTURE_COMPRESSED_DXT23 0x87 4x4 pixels compressed to 16 bytes
CELL_GCM_TEXTURE_COMPRESSED_DXT45 0x88 4x4 pixels compressed to 16 bytes
CELL_GCM_TEXTURE_G8B8 0x8B Two 8-bit unsigned integers
CELL_GCM_TEXTURE_R6G5B5 0x8F 6-bit, 5-bit, and 5-bit unsigned integers
CELL_GCM_TEXTURE_DEPTH24_D8 0x90 One 24-bit fixed, and 8-bit dummy data
CELL_GCM_TEXTURE_DEPTH24_D8_FLOAT 0x91 One 24-bit float, and 8-bit dummy data
CELL_GCM_TEXTURE_DEPTH16 0x92 One 16-bit fixed
CELL_GCM_TEXTURE_DEPTH16_FLOAT 0x93 One 16-bit float value
CELL_GCM_TEXTURE_X16 0x94 One 16-bit integer
CELL_GCM_TEXTURE_Y16_X16 0x95 Two 16-bit integer
CELL_GCM_TEXTURE_R5G5B5A1 0x97 Three 5-bit unsigned integers, and one 1-bit value
CELL_GCM_TEXTURE_COMPRESSED_HILO8 0x98 Two unsigned 16-bit values compressed to two 8-bit values
CELL_GCM_TEXTURE_COMPRESSED_HILO_S8 0x99 Two signed 16-bit values compressed to two 8-bit values
CELL_GCM_TEXTURE_W16_Z16_Y16_X16_FLOAT 0x9A Four 16-bit float values
CELL_GCM_TEXTURE_W32_Z32_Y32_X32_FLOAT 0x9B Four 32-bit float values
CELL_GCM_TEXTURE_X32_FLOAT 0x9C One 32-bit float value
CELL_GCM_TEXTURE_D1R5G5B5 0x9D 1-bit dummy data, and three 5-bit unsigned integers
CELL_GCM_TEXTURE_D8R8G8B8 0x9E 8-bit dummy data, and three 8-bit unsigned integers
CELL_GCM_TEXTURE_Y16_X16_FLOAT 0x9F Two 16-bit float values
CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8 0xAD Two pixels compressed in the YUV format to 32 bits
CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8 0xAE Two pixels compressed in the YUV format to 32 bits

Swizzle flag[edit | edit source]

Swizzle can only be used when the width is not a power of two. Pitch must be specified.

Name Value Comments
CELL_GCM_TEXTURE_SZ 0x0 Use the swizzle format
CELL_GCM_TEXTURE_LN 0x20 Use the linear format

Normalization flag[edit | edit source]

Name Value Comments
CELL_GCM_TEXTURE_NR 0x0 Normalize texture coordinates
CELL_GCM_TEXTURE_UN 0x40 Do not normalize texture coordinates

Dimension[edit | edit source]

Depth textures cannot be 3D.

Name Value Comments

CubeMapEnable[edit | edit source]

Name Value Comments

Location[edit | edit source]

Name Value Comments
CELL_GCM_LOCATION_LOCAL + 1 1 Local memory
CELL_GCM_LOCATION_MAIN + 1 2 Main memory

renderengine::Texture::Type[edit | edit source]

Name Value Comments
TYPE_CUBE 0x10002