Texture/PlayStation 3: Difference between revisions

m
Normalization
(Created page.)
 
m (Normalization)
 
(4 intermediate revisions by the same user not shown)
Line 1:
= LayoutStructures =
The majority of this information is from the SCE PS3 SDK: CellGcmTexture datatype reference, though Burnout's debugging symbols were also referenced.
 
Line 6:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x1 || uint8_t || m_format || Texture format || See [[#Format | 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 | dimension]]
|-
| 0x3 || 0x1 || uint8_t || m_cubemap || Enable or disable cube mapping || See [[#CubeMapEnable | CubeMapEnable]]
|-
| 0x4 || 0x4 || uint32_t || m_remap || Method of selecting each element of the color value || See [[#Remap | remap]]
|-
| 0x8 || 0x2 || uint16_t || m_width || Width of texture (1-4096) ||
Line 22:
| 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 | location]]
|-
| 0xF || 0x1 || uint8_t || m_padding || Padding ||
|-
| 0x10 || 0x4 || uint32_t || m_pitch || Pitch size of texture || See [[#Pitch | 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 || [[#renderengine::Texture::Type|Type]] || m_storeType || Store type || See [[#renderengine::Texture::Type | type]]
|-
| 0x20 || 0x4 || uint32_t || m_storeFlags || Store flags || Seemingly unused
Line 41:
 
Below is the bitwise structure for the format field.
 
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|-
| 70 || 1 || || || Unused, always 1
! Bit !! Length !! Comments
|-
| 01 || 51 || Color format.|| Normalization flag || See [[#Color formatNormalization flag|normalization color formatflag]]
|-
| 52 || 1 || || Swizzle flag. || See [[#Swizzle flag | swizzle flag]]
|-
| 63 || 15 || Normalization flag.|| Color format || See [[#Normalization flagColor format|color normalization flagformat]]
|-
| 7 || 1 || Unused, always 1
|}
 
Line 57:
{| class="wikitable"
|+ Format 0x88
|-
! Bit value !! 1 !! 0 !! 0 !! 0 !! 1 !! 0 !! 0 !! 0
|-
| '''Parsed value''' || 1 || 0 || 0 || colspan=5 | 8
|-
| '''Description''' || Unused || CELL_GCM_TEXTURE_NR || CELL_GCM_TEXTURE_SZ || colspan=5 | CELL_GCM_TEXTURE_COMPRESSED_DXT45
|}
 
Line 75 ⟶ 74:
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.
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|-
| 0 || 16 || || Remap order ||
! Bit !! Length !! Comments
|-
| 016 || 162 || Remap order|| Output blue element ||
|-
| 1618 || 2 || || Output bluegreen element ||
|-
| 1820 || 2 || || Output greenred element ||
|-
| 2022 || 2 || || Output redalpha element ||
|-
| 2224 || 2 || Output alpha|| Input blue element ||
|-
| 2426 || 2 || || Input bluegreen element ||
|-
| 2628 || 2 || || Input greenred element ||
|-
| 2830 || 2 || || Input redalpha element ||
|-
| 30 || 2 || Input alpha element
|}
 
Line 221 ⟶ 219:
=== renderengine::Texture::Type ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-