Texture/Xbox 360: Difference between revisions

m
no edit summary
(Created page.)
 
mNo edit summary
(5 intermediate revisions by the same user not shown)
Line 1:
= LayoutStructures =
Most of this information is derived from the MS Xbox 360 SDK and [[Burnout Paradise (2008-01-30 build)]]'s XDB.
 
=== D3DBaseTexture ===
{| class="wikitable"
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || DWORD || Common || || See [[#Common | Common]]
|-
| 0x4 || 0x4 || DWORD || ReferenceCount || ||
Line 21 ⟶ 20:
| 0x18 || 0x4 || DWORD || MipFlush || ||
|-
| 0x1C || 0x18 || [[#GPUTEXTURE_FETCH_CONSTANT|GPUTEXTURE_FETCH_CONSTANT]] || Format || ||
| 0x1C || 0x18 || DWORD[6] || GPUTEXTURE_FETCH_CONSTANT || || See [[#GPUTEXTURE_FETCH_CONSTANT | GPUTEXTURE_FETCH_CONSTANT]]
|}
 
Line 28 ⟶ 27:
 
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|-
| 0 || 28 || Flags || D3D resource flags ||
! Bit !! Length !! Name !! Description !! Comments
|-
| 028 || 4 || Type || D3D resource type || See [[#D3DRESOURCETYPE | D3DRESOURCETYPE]]
|-
| 4 || 28 || Flags || D3D resource flags ||
|}
 
=== GPUTEXTURE_FETCH_CONSTANT ===
Official documentation is in LSB 0 notation. It has been converted to MSB 0 and its DWORDs have been merged into one table.
To prevent confusion, the structure of GPUTEXTURE_FETCH_CONSTANT is split into its 6 fields and shown in LSB 0 notation.
 
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|+ GPUTEXTURE_FETCH_CONSTANT[0]
|-
| 0 || 1 || Tiled || || Start of DWORD 0
! Bit !! Length !! Name !! Description !! Comments
|-
| 01 || 29 || TypePitch || || See [[#GPUCONSTANTTYPE | GPUCONSTANTTYPE]]
|-
| 210 || 21 || SignX || Padding || See [[#GPUSIGN | GPUSIGN]]
|-
| 411 || 2 || SignYMultiSample || || D3D construct: not used by hardware<br/>See [[#GPUSIGN GPUMULTISAMPLE_TYPE| GPUSIGNGPUMULTISAMPLE_TYPE]]
|-
| 613 || 23 || SignZClampZ || || See [[#GPUSIGN GPUCLAMP| GPUSIGNGPUCLAMP]]
|-
| 816 || 23 || SignWClampY || || See [[#GPUSIGN GPUCLAMP| GPUSIGNGPUCLAMP]]
|-
| 1019 || 3 || ClampX || || See [[#GPUCLAMP | GPUCLAMP]]
|-
| 1322 || 32 || ClampYSignW || || See [[#GPUCLAMP GPUSIGN| GPUCLAMPGPUSIGN]]
|-
| 1624 || 32 || ClampZSignZ || || See [[#GPUCLAMP GPUSIGN| GPUCLAMPGPUSIGN]]
|-
| 1926 || 2 || MultiSampleSignY || || D3D construct: not used by hardware<br/>See [[#GPUMULTISAMPLE_TYPE GPUSIGN| GPUMULTISAMPLE_TYPEGPUSIGN]]
|-
| 2128 || 12 || SignX || padding || See [[#GPUSIGN|GPUSIGN]]
|-
| 2230 || 92 || PitchType || || See [[#GPUCONSTANTTYPE|GPUCONSTANTTYPE]]
|-
| 3132 || 120 || TiledBaseAddress || || Start of DWORD 1
|}
 
{| class="wikitable"
|+ GPUTEXTURE_FETCH_CONSTANT[1]
|-
| 52 || 1 || ClampPolicy || || See [[#GPUCLAMPPOLICY|GPUCLAMPPOLICY]]
! Bit !! Length !! Name !! Description !! Comments
|-
| 053 || 61 || DataFormatStacked || || See [[#GPUTEXTUREFORMAT | GPUTEXTUREFORMAT]]
|-
| 654 || 2 || EndianRequestSize || || See [[#GPUENDIAN GPUREQUESTSIZE| GPUENDIANGPUREQUESTSIZE]]
|-
| 856 || 2 || RequestSizeEndian || || See [[#GPUREQUESTSIZE GPUENDIAN| GPUREQUESTSIZEGPUENDIAN]]
|-
| 1058 || 16 || StackedDataFormat || || See [[#GPUTEXTUREFORMAT|GPUTEXTUREFORMAT]]
|-
| 1164 || 132 || ClampPolicySize || || Start of DWORD 2<br/>See [[#GPUCLAMPPOLICY GPUTEXTURESIZE| GPUCLAMPPOLICYGPUTEXTURESIZE]]
|-
| 1296 || 201 || BaseAddressBorderSize || || Start of DWORD 3
|}
 
{| class="wikitable"
|+ GPUTEXTURE_FETCH_CONSTANT[2]
|-
| 97 || 3 || || Padding ||
! Bit !! Length !! Name !! Description !! Comments
|-
| 0100 || 323 || SizeAnisoFilter || || See [[#GPUTEXTURESIZE GPUANISOFILTER| GPUTEXTURESIZEGPUANISOFILTER]]
|}
 
{| class="wikitable"
|+ GPUTEXTURE_FETCH_CONSTANT[3]
|-
| 103 || 2 || MipFilter || || See [[#GPUMIPFILTER|GPUMIPFILTER]]
! Bit !! Length !! Name !! Description !! Comments
|-
| 0105 || 12 || NumFormatMinFilter || || See [[#GPUNUMFORMAT GPUMINMAGFILTER| GPUNUMFORMATGPUMINMAGFILTER]]
|-
| 1107 || 32 || SwizzleXMagFilter || || See [[#GPUSWIZZLE GPUMINMAGFILTER| GPUSWIZZLEGPUMINMAGFILTER]]
|-
| 4109 || 36 || SwizzleYExpAdjust || || See [[#GPUSWIZZLE | GPUSWIZZLE]]
|-
| 7115 || 3 || SwizzleZSwizzleW || || See [[#GPUSWIZZLE | GPUSWIZZLE]]
|-
| 10118 || 3 || SwizzleWSwizzleZ || || See [[#GPUSWIZZLE | GPUSWIZZLE]]
|-
| 13121 || 63 || ExpAdjustSwizzleY || || See [[#GPUSWIZZLE|GPUSWIZZLE]]
|-
| 19124 || 23 || MagFilterSwizzleX || || See [[#GPUMINMAGFILTER GPUSWIZZLE| GPUMINMAGFILTERGPUSWIZZLE]]
|-
| 21127 || 21 || MinFilterNumFormat || || See [[#GPUMINMAGFILTER GPUNUMFORMAT| GPUMINMAGFILTERGPUNUMFORMAT]]
|-
| 23128 || 25 || MipFilterGradExpAdjustV || || SeeStart [[#GPUMIPFILTERof |DWORD GPUMIPFILTER]]4
|-
| 25133 || 35 || AnisoFilterGradExpAdjustH || || See [[#GPUANISOFILTER | GPUANISOFILTER]]
|-
| 28138 || 310 || LODBias || padding ||
|-
| 31148 || 1 || BorderSizeMinAnisoWalk || ||
|}
 
{| class="wikitable"
|+ GPUTEXTURE_FETCH_CONSTANT[4]
|-
| 149 || 1 || MagAnisoWalk || ||
! Bit !! Length !! Name !! Description !! Comments
|-
| 0150 || 14 || VolMagFilterMaxMipLevel || || See [[#GPUMINMAGFILTER | GPUMINMAGFILTER]]
|-
| 1154 || 14 || VolMinFilterMinMipLevel || || See [[#GPUMINMAGFILTER | GPUMINMAGFILTER]]
|-
| 2158 || 41 || MinMipLevelVolMinFilter || || See [[#GPUMINMAGFILTER|GPUMINMAGFILTER]]
|-
| 6159 || 41 || MaxMipLevelVolMagFilter || || See [[#GPUMINMAGFILTER|GPUMINMAGFILTER]]
|-
| 10160 || 120 || MagAnisoWalkMipAddress || || Start of DWORD 5
|-
| 11180 || 1 || MinAnisoWalkPackedMips || ||
|-
| 12181 || 102 || LODBiasDimension || || See [[#GPUDIMENSION|GPUDIMENSION]]
|-
| 22183 || 54 || GradExpAdjustHAnisoBias || ||
|-
| 27187 || 52 || GradExpAdjustVTriClamp || || See [[#GPUTRICLAMP|GPUTRICLAMP]]
|}
 
{| class="wikitable"
|+ GPUTEXTURE_FETCH_CONSTANT[5]
|-
! Bit !! Length !! Name !! Description !! Comments
|-
| 0 || 2 || BorderColor || || See [[#GPUBORDERCOLOR | GPUBORDERCOLOR]]
|-
| 2 || 1 || ForceBCWToMax || ||
|-
| 3 || 2 || TriClamp || || See [[#GPUTRICLAMP | GPUTRICLAMP]]
|-
| 5 || 4 || AnisoBias || ||
|-
| 9 || 2 || Dimension || || See [[#GPUDIMENSION | GPUDIMENSION]]
|-
| 11189 || 1 || PackedMipsForceBCWToMax || ||
|-
| 12190 || 202 || MipAddressBorderColor || || See [[#GPUBORDERCOLOR|GPUBORDERCOLOR]]
|}
 
=== GPUTEXTURESIZE ===
Four structures used in the union <code>[[#Size</code>:|Size]].
 
{| class="wikitable"
|+ Size
|-
! Type !! Name !! Description !! Comments
|-
| GPUTEXTURESIZE_1D || OneD || || See [[#GPUTEXTURESIZE_1D | GPUTEXTURESIZE_1D]]
|-
| GPUTEXTURESIZE_2D || TwoD || || See [[#GPUTEXTURESIZE_2D | GPUTEXTURESIZE_2D]]
|-
| GPUTEXTURESIZE_3D || ThreeD || || See [[#GPUTEXTURESIZE_3D | GPUTEXTURESIZE_3D]]
|-
| GPUTEXTURESIZE_STACK || Stack || || See [[#GPUTEXTURESIZE_STACK | GPUTEXTURESIZE_STACK]]
|}
 
==== GPUTEXTURESIZE_1D ====
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|-
! Bit !! Length !! Name !! Description !! Comments
|-
| 0 || 24 || Width || ||
|-
| 24 || 8 || || paddingPadding ||
|}
 
==== GPUTEXTURESIZE_2D ====
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|-
! Bit !! Length !! Name !! Description !! Comments
|-
| 0 || 13 || Width || ||
Line 205 ⟶ 155:
| 13 || 13 || Height || ||
|-
| 26 || 6 || || paddingPadding ||
|}
 
==== GPUTEXTURESIZE_3D ====
{| class="wikitable"
! Offset (bits) !! Length (bits) !! Name !! Description !! Comments
|-
! Bit !! Length !! Name !! Description !! Comments
|-
| 0 || 11 || Width || ||
Line 222 ⟶ 171:
==== GPUTEXTURESIZE_STACK ====
{| class="wikitable"
! Offsets (bits) !! Length (bits) !! Name !! Description !! Comments
|-
! Bit !! Length !! Name !! Description !! Comments
|-
| 0 || 13 || Width || ||
Line 230 ⟶ 178:
|-
| 26 || 6 || Depth || ||
|}
 
= Unions =
=== Size ===
{| class="wikitable"
! Length !! Type !! Name !! Description !! Comments
|-
| 0x4 || [[#GPUTEXTURESIZE_1D|GPUTEXTURESIZE_1D]] || OneD || ||
|-
| 0x4 || [[#GPUTEXTURESIZE_2D|GPUTEXTURESIZE_2D]] || TwoD || ||
|-
| 0x4 || [[#GPUTEXTURESIZE_3D|GPUTEXTURESIZE_3D]] || ThreeD || ||
|-
| 0x4 || [[#GPUTEXTURESIZE_STACK|GPUTEXTURESIZE_STACK]] || Stack || ||
|}
 
Line 237 ⟶ 199:
=== D3DRESOURCETYPE ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 281 ⟶ 242:
=== GPUCONSTANTTYPE ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 295 ⟶ 255:
=== GPUSIGN ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 309 ⟶ 268:
=== GPUCLAMP ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 331 ⟶ 289:
=== GPUMULTISAMPLE_TYPE ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 344 ⟶ 301:
 
=== GPUTEXTUREFORMAT ===
Note that Burnout's textures do not appear to have identical format codes—DXT1 is 52 instead of 51 and DXT5 is 54 instead of 53.
 
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 481 ⟶ 435:
=== GPUENDIAN ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 495 ⟶ 448:
=== GPUREQUESTSIZE ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 505 ⟶ 457:
=== GPUCLAMPPOLICY ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 515 ⟶ 466:
=== GPUNUMFORMAT ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 525 ⟶ 475:
=== GPUSWIZZLE ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 543 ⟶ 492:
=== GPUMINMAGFILTER ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 555 ⟶ 503:
=== GPUMIPFILTER ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 569 ⟶ 516:
=== GPUANISOFILTER ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 589 ⟶ 535:
=== GPUBORDERCOLOR ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 603 ⟶ 548:
=== GPUTRICLAMP ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
Line 617 ⟶ 561:
=== GPUDIMENSION ===
{| class="wikitable"
|-
! Name !! Value !! Comments
|-