Texture/Remastered: Difference between revisions

m
no edit summary
(Add texture data field)
mNo edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1:
= LayoutStructures =
At least partially derived from [https://docslearn.microsoft.com/en-us/windows/win32/direct3d11/d3dx11-image-info D3DX11_IMAGE_INFO] or a related structure.
 
=== 32-bitHeader ===
==== 32-bit ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || InterfaceUnion[[#Texture interface|Texture interface]]* || ? || Texture interface || nullptr in file. The game sets this pointer in memory.<br/>The interface is chosen by the texture type.<br/>See [[#InterfaceUnion | InterfaceUnion]]
|-
| 0x4 || 0x4 || ?[[#D3D11_USAGE|D3D11_USAGE]] || ? || Usage ||
|-
| 0x8 || 0x4 || ?int32_t || ? || Dimension || See [[#Dimension|dimension]]
|-
| 0xC || 0x4 || void* || ? || Pixel data || Offset in file. The game sets this pointer in memory.
Line 20 ⟶ 21:
| 0x18 || 0x4 || ? || ? || ||
|-
| 0x1C || 0x4 || [[#DXGI_FORMAT|DXGI_FORMAT]] || Format || A DXGI_FORMAT enumeration specifying the format the texture will be in after it is loaded. || See [[#DXGI_FORMAT | DXGI_FORMAT]]
|-
| 0x20 || 0x4 || uint32_t || ? || Flags || See [[#Flags|flags]]
|-
| 0x24 || 0x2 || uint16_t || Width || The target width of the texture. If the actual width of the texture is larger or smaller than this value then the texture will be scaled up or down to fit this target width. ||
Line 40 ⟶ 41:
| 0x30 || 0x4 || void* || ? || ||
|-
| 0x34 || 0x4 || ?uint32_t || ? || Array index || Must be less than 32
|-
| 0x38 || 0x4 || uint32_t || ? || Contents size || Size of the texture data. Used on PS4 and NX
Line 47 ⟶ 48:
|}
 
==== InterfaceUnion64-bit ====
Real name is unknown.
 
{| class="wikitable"
|-
! Type !! Name !! Description !! Comments
|-
| ID3D11Texture1D* || ? || 1D texture interface ||
|-
| ID3D11Texture2D* || ? || 2D texture interface ||
|-
| ID3D11Texture3D* || ? || 3D texture interface ||
|}
 
== 64-bit ==
'''Note:''' This is guessed based on differences from the 32-bit structure. There is an extra line of data after the end; one or more fields after the mip levels may be pointers.
 
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x8 || InterfaceUnion[[#Texture interface|Texture interface]]* || ? || Texture interface || nullptr in file. The game sets this pointer in memory.<br/>The interface is chosen by the texture type.<br/>See [[#InterfaceUnion | InterfaceUnion]]
|-
| 0x8 || 0x4 || ? || ? || ||
Line 81 ⟶ 66:
| 0x28 || 0x4 || ? || ? || ||
|-
| 0x2C || 0x4 || [[#DXGI_FORMAT|DXGI_FORMAT]] || Format || A DXGI_FORMAT enumeration specifying the format the texture will be in after it is loaded. || See [[#DXGI_FORMAT | DXGI_FORMAT]]
|-
| 0x30 || 0x4 || uint32_t || ? || Flags ||
Line 106 ⟶ 91:
|-
| 0x50 || 0x8 || void* || ? || Texture data || nullptr in file. Set in memory. Used on PS4
|}
 
= Unions =
=== Texture interface ===
Anonymous union.
 
==== 32-bit ====
{| class="wikitable"
! Length !! Type !! Name !! Description !! Comments
|-
| 0x4 || ID3D11Resource* || m_resource || Resource interface ||
|-
| 0x4 || ID3D11Texture1D* || m_texture1d || 1D texture interface ||
|-
| 0x4 || ID3D11Texture2D* || m_texture2d || 2D texture interface ||
|-
| 0x4 || ID3D11Texture3D* || m_texture3d || 3D texture interface ||
|}
 
==== 64-bit ====
{| class="wikitable"
! Length !! Type !! Name !! Description !! Comments
|-
| 0x8 || ID3D11Resource* || m_resource || Resource interface ||
|-
| 0x8 || ID3D11Texture1D* || m_texture1d || 1D texture interface ||
|-
| 0x8 || ID3D11Texture2D* || m_texture2d || 2D texture interface ||
|-
| 0x8 || ID3D11Texture3D* || m_texture3d || 3D texture interface ||
|}
 
= Enumerations =
=== D3D11_USAGE ===
From [https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_usage D3D11_USAGE on Microsoft Learn].
 
{| class="wikitable"
! Name !! Value !! Comments
|-
| D3D11_USAGE_DEFAULT || 0 ||
|-
| D3D11_USAGE_IMMUTABLE || 1 ||
|-
| D3D11_USAGE_DYNAMIC || 2 ||
|-
| D3D11_USAGE_STAGING || 3 ||
|}
 
=== Dimension ===
{| class="wikitable"
! Name !! Value !! Comments
|-
| ? || 6 || 1D texture
|-
| ? || 7 || 2D texture
|-
| ? || 8 || 3D texture
|-
| ? || 9 || Cube texture
|}
 
=== DXGI_FORMAT ===
From [https://docslearn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format DXGI_FORMAT on Microsoft DocsLearn].
 
{| class="wikitable"
! Name !! Value !! Comments
|-
| DXGI_FORMAT_UNKNOWN || 0 || The format is not known.
|-
Line 356 ⟶ 401:
|-
| DXGI_FORMAT_FORCE_UINT || 0xFFFFFFFF || Forces this enumeration to compile to 32 bits in size. This value is not used.
|}
 
=== Flags ===
{| class="wikitable"
! Name !! Value !! Comments
|-
| ? || 0x1 ||
|-
| ? || 0x2 ||
|-
| ? || 0x4 ||
|-
| ? || 0x8 ||
|-
| ? || 0x10 ||
|-
| ? || 0x20 ||
|-
| ? || 0x40 ||
|-
| ? || 0x80 ||
|-
| ? || 0x100 ||
|-
| ? || 0x200 ||
|}