From 9a26e1ee361059348b0bd3b3c4206c1ca00f51fd Mon Sep 17 00:00:00 2001 From: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com> Date: Wed, 25 Nov 2026 01:55:17 -0300 Subject: [PATCH 1/2] docs: inventory texture formats and layouts by stage (#260) Add docs/research/texture-formats.md, built from BetterXen main. For RGBA8, BC1-BC7 and Depth32Float it separates container recognition, CPU decoding, layout conversion, native Metal upload and readback, translated sampling and guest reachability, linking the implementing files and tests for each cell, including the packed BC footprints from It cross-references #208 and #209 rather than opening duplicate tasks, records console layouts, console descriptors and asset or audio containers as unknowns, and ranks three proposed follow-ups with an original-fixture recipe, an independent source of expected values and an owner each. Deferred formats with no demonstrated need are listed. docs/README.md indexes the page. Research only; no code changed. Ported from XenoraOSS/Xenora#427 and re-checked against BetterXen main. Signed-off-by: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com> --- CHANGELOG.md | 1 + docs/README.md | 1 + docs/research/texture-formats.md | 94 ++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 docs/research/texture-formats.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 78da0a4..4045fcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Guest execution uses original, purpose-built test programs. Commercial Xbox game remains unsupported. ### Added +- Added `docs/research/texture-formats.md`, an inventory of the texture formats and layouts BetterXen handles (#260). For BC1–BC7, RGBA8 and Depth32Float it separates container recognition, CPU decoding, layout conversion, native Metal upload and readback, translated sampling and guest reachability, and links the implementing files, tests and public specifications, including the packed BC footprints from #241. It cross-references #208 and #209 instead of opening duplicate tasks, lists console layouts, console descriptors and asset or audio containers as unknowns, and ranks three proposed follow-ups with fixture recipes and owners. Research only; no implementation changed. - Rewrote the README around the six development phases and the first-launchable-application target (#311), with colour-coded Mermaid diagrams (system flow, milestone roadmap, CPU, runtime-service and shader-form charts built from the generated registries), badges, a repository overview, a contributing section and corrected texture-sampling wording. The older X1–X25 capability map is kept in a collapsible section. The diagrams were not render-tested locally. - Added a fast "Repository hygiene" check (`.github/workflows/hygiene.yml`, `scripts/audit/docs_hygiene.py`). It runs on Ubuntu without a Rust toolchain or network access and fails only on merge-conflict markers, broken relative Markdown links and invalid workflow YAML in tracked files. A separate advisory step warns, without failing, when source or script changes have no changelog entry. A local run over the 626 tracked files found no problems, and planted failures of each kind were caught; it has not yet run on GitHub. diff --git a/docs/README.md b/docs/README.md index 254a1ce..30c0636 100644 --- a/docs/README.md +++ b/docs/README.md @@ -60,6 +60,7 @@ Historical phase checkpoints retain their original evidence scope. - [Public sources](research/sources.md), [RDNA 2 notes](research/rdna2.md), and [Xbox GPU evidence](research/xbox-gpu.md) — Specifications, evidence scope, and unknown console behavior. - [Shader inputs](research/shader-containers.md) and [risk register](risk-register.md) — Input provenance and unresolved engineering risks. +- [Texture format inventory](research/texture-formats.md) — Formats and layouts by stage (decode, layout, native upload, sampling, guest), their public specifications, unknowns and ranked follow-ups. - [PortWatch native macOS research](research/portwatch-native-macos.md) — Screening of public Xbox-on-Windows port projects for native macOS planning; discovery only. - [Synthetic integration and upstream evidence](research/synthetic-integration.md) — Audited source snapshots and remaining commercial startup prerequisites. diff --git a/docs/research/texture-formats.md b/docs/research/texture-formats.md new file mode 100644 index 0000000..53843d1 --- /dev/null +++ b/docs/research/texture-formats.md @@ -0,0 +1,94 @@ +# Texture format and layout inventory + +This page records which texture formats and memory layouts BetterXen handles today, and at which stage. It also records which gaps are worth closing and which are deferred. It is an inventory of the repository at the time of writing, built from the code and tests it links. It is not a support claim: a format listed here works only for the original synthetic fixtures named, on desktop specifications, and nothing here says anything about Xbox hardware or commercial titles. + +## Stages + +A format can be handled at one stage and missing at the next. The columns below keep them apart: + +- **Container**: recognising a file or package format that holds textures (DDS, KTX and similar). +- **CPU decode**: turning one compressed block into texels on the CPU, used as an independent reference. +- **Layout**: converting between a stored memory layout and the row-major layout Metal expects. +- **Native**: uploading to a Metal texture of that pixel format and reading it back on the GPU. +- **Sampling**: a translated RDNA 2 image instruction reading the texture inside a shader. +- **Guest**: a guest program reaching the path through the project's D3D12-style graphics services. + +"—" means not implemented. "Rejected" means the input is refused with an error rather than handled. + +## Formats + +| Format | Container | CPU decode | Layout | Native | Sampling | Guest | +| --- | --- | --- | --- | --- | --- | --- | +| RGBA8 unorm | — | not needed | row-major mips, direct or budgeted staged upload (`crates/metal/src/texture_pipeline.rs`) | upload and render target (`render_rgba8*`, `crates/metal/tests/native/texture_sampling.rs`) | `image_sample_lz`, 2D, level 0 (`crates/isa/src/lib.rs`, `crates/metal/tests/native/translated_render.rs`) | one-level 2D SRV, `DXGI_FORMAT_R8G8B8A8_UNORM` (`crates/loader/src/graphics.rs`, `crates/loader/tests/graphics_textures.rs`) | +| BC1 | — | `decode_bc1` (`crates/texture/src/lib.rs`) | synthetic tiled layout, pitched uploads (`TiledBc1`, `Bc1Upload`) and per-subresource packed footprints (`BcTextureLayout`, `PackedBcUpload`) | `read_tiled_bc1`, `read_bc1_upload`, including packed footprints (`crates/metal/tests/native/texture.rs`, `crates/metal/tests/packed_bc_upload.rs`) | sampled by the translated `image_sample_lz` pixel stage (`render_rgba8_sampled_bc1`, `crates/metal/tests/native/translated_bc1.rs`) | one-level 2D SRV, `DXGI_FORMAT_BC1_UNORM` (same files as RGBA8) | +| BC2, BC3 | — | `decode_bc2`, `decode_bc3` (`crates/texture/src/bc.rs`, `crates/texture/tests/bc_formats.rs`) | pitched upload (`BcAlphaUpload`) and packed footprints | `read_bc_alpha_upload`, including packed footprints (`crates/metal/tests/native/texture_bc_alpha.rs`, `crates/metal/tests/packed_bc_upload.rs`) | — | — | +| BC4, BC5 (unorm, snorm) | — | `decode_bc4_*`, `decode_bc5_*` (`crates/texture/src/bc.rs`, `crates/texture/tests/bc_formats.rs`) | pitched upload (`BcChannelUpload`) and packed footprints | `read_bc_channel_upload`, including packed footprints (`crates/metal/tests/native/texture_bc_channel.rs`, `crates/metal/tests/packed_bc_upload.rs`) | — | — | +| BC6H (ufloat, sfloat) | — | single-subset modes only; two-subset modes rejected (`crates/texture/src/bc6h.rs`, `crates/texture/tests/bc6h.rs`) | packed footprints only, 16-byte blocks (`crates/texture/src/footprint.rs`) | — | — | — | +| BC7 unorm | — | all eight modes (`crates/texture/src/bc7.rs`, `crates/texture/tests/bc7.rs`) | packed footprints only, 16-byte blocks (`crates/texture/src/footprint.rs`) | — | — | — | +| BC7 sRGB | — | same bytes as BC7; the sRGB transfer function is outside the decoder | — | — | — | — | +| Depth32Float | — | not needed | render attachment | `render_depth` with depth readback (`crates/metal/tests/native/depth.rs`) | — | — | + +Sampler state is limited to nearest filtering and clamp-to-edge addressing (`crates/texture/src/sampler.rs`). Other filter or address modes are rejected. + +Native BC paths require `supportsBCTextureCompression`. A device without it fails as a capability error (`crates/metal/src/compute.rs`), separately from implementation failures. + +Known source differences, recorded where they are implemented: + +- **BC6H:** the Khronos text and Microsoft's sample code disagree on whether a negative value that rounds to zero keeps its sign (`-0.0` against `0.0`). `bc6h.rs` follows Khronos. +- **BC1:** Apple's hardware rounds BC1's interpolated palette entries differently from the spec-exact decoder (171/84 against 170/85, see `CHANGELOG.md`). The sampled BC1 fixtures therefore use only endpoint colours. + +## Layouts + +| Layout | State | Where | +| --- | --- | --- | +| Row-major RGBA8 mips | implemented | `crates/metal/src/texture_pipeline.rs` | +| Budgeted staged RGBA8 upload | implemented | `MetalRgba8Texture::upload_staged`, `crates/metal/src/texture_pipeline.rs` | +| Pitched, layer-major BC uploads (one pitch for every mip, padded slices) | implemented for BC1–BC5 | `crates/texture/src/upload.rs` | +| Per-subresource packed footprints for block-compressed mip chains (tight or aligned rows) | layout implemented for BC1–BC7; native readback covers BC1–BC5 (#241, PR #278) | `crates/texture/src/footprint.rs`, `crates/texture/tests/bc_footprint.rs`, `crates/metal/tests/packed_bc_upload.rs` | +| The synthetic 2×2-tile BC1 layout | implemented; defined by the project's fixtures, not by any console | `crates/texture/src/lib.rs` | +| Desktop RDNA 2 surface tiling (swizzle modes) | unknown; not researched in this repository | — | +| Console texture memory layouts | unknown; no public source reviewed | — | + +## Public specifications + +These are the primary sources the implementations above cite. The format rows already name them in their source files. + +- Khronos Data Format Specification 1.3: the S3TC section (BC1–BC3), the RGTC section (BC4, BC5), section 20.1 "BC7" and section 20.2 "BC6H". +- Microsoft Direct3D documentation: "Texture Block Compression in Direct3D 11", "Block Compression (Direct3D 10)", "BC6H Format" and "BC7 Format". These are used for the format definitions and DXGI format codes, not for console behaviour. +- Apple Metal documentation: `MTLPixelFormat` and `MTLDevice.supportsBCTextureCompression`, for the native pixel formats and the capability check. +- AMD "RDNA 2" Instruction Set Architecture reference guide (GPUOpen): MIMG instructions such as `image_sample_lz`, and the image resource and sampler descriptor formats. These cover desktop gfx1030 only. [Xbox GPU evidence](xbox-gpu.md) records why desktop statements do not transfer to the console without separate evidence. + +## Unknowns + +These are research questions, not missing features: + +- **Console texture memory layouts and tiling.** No public specification has been reviewed. Desktop RDNA 2 tiling would be a separate research note and would still not establish console behaviour. +- **Console resource descriptor formats.** Unknown. See [Xbox GPU evidence](xbox-gpu.md), which lists descriptor layout among the unresolved items. +- **Asset and audio containers.** BetterXen parses none. The runtime's audio path accepts only raw PCM (`XENORA_AUDIO_FORMAT_PCM_S16LE` and `PCM_F32LE` in `crates/ffi/include/xenora.h`). No original workload has shown a need for a container or a compressed audio format. + +## Follow-ups + +Ranked by how close each is to existing tested paths. The first item is already tracked; the others are proposals, so do not start them without an issue and a claim. + +1. **BC6H two-subset modes and native BC6H/BC7.** Tracked in #208 (CPU decode, with an archived request to take it) and #209 (native upload and readback, whose imported proposal waits for maintainer approval). BC6H and BC7 already have packed footprints, so #209 can build on `PackedBcUpload`. Do not duplicate them. +2. **Translated sampling of BC2–BC5.** + - Fixture: original blocks with hand-chosen endpoints and indices, sampled by the existing `image_sample_lz` pixel stage. + - Expected values: derived by hand from the Khronos tables. The `bc.rs` decoders must not produce them, so that the decoder and the reference stay independent. + - Owners: Metal and Compiler. +3. **Additional sampler state** (linear filtering, wrap and mirror addressing). + - Fixture: a small original RGBA8 texture with distinct texels. + - Expected values: from the public Direct3D and Metal sampling equations, computed in exact fractions. + - Owners: Metal and Compiler. +4. **Desktop RDNA 2 image resource descriptor decoding.** Needed before guest-supplied descriptors can select formats. + - Fixture: original descriptor words for each supported format. + - Expected values: from the AMD RDNA 2 ISA guide's descriptor tables. + - Owner: ISA. + - This does not cover console descriptors. + +Deferred, with no demonstrated need: + +- BC7 sRGB +- DDS and KTX containers +- ASTC and ETC (not part of the desktop Direct3D 12 BC set this target uses) +- any compressed audio format +- console tiling, until a public source exists From 2b113a2e5ed6e4fc0d65e4b10019df5d26580cab Mon Sep 17 00:00:00 2001 From: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com> Date: Wed, 25 Nov 2026 02:17:44 -0300 Subject: [PATCH 2/2] docs: separate host API coverage from guest reachability and link sources (#260) Review follow-up. The Guest column credited the descriptor-table SRVs, which tests call directly from Rust and the interface contract says are not yet wired to guest imports. The table now has a Host graphics API column for them and keeps Guest for paths an original PE fixture reaches through imported services: today only RGBA8, through the synthetic xenora.dll texture services of the Gate 5 fixture. Every repository path is now a relative link, and each format row links the exact Khronos DFS 1.3 section and Microsoft or Apple page it relies on. Signed-off-by: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com> --- CHANGELOG.md | 2 +- docs/research/texture-formats.md | 48 +++++++++++++++++--------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4045fcd..7d4e221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ Guest execution uses original, purpose-built test programs. Commercial Xbox game remains unsupported. ### Added -- Added `docs/research/texture-formats.md`, an inventory of the texture formats and layouts BetterXen handles (#260). For BC1–BC7, RGBA8 and Depth32Float it separates container recognition, CPU decoding, layout conversion, native Metal upload and readback, translated sampling and guest reachability, and links the implementing files, tests and public specifications, including the packed BC footprints from #241. It cross-references #208 and #209 instead of opening duplicate tasks, lists console layouts, console descriptors and asset or audio containers as unknowns, and ranks three proposed follow-ups with fixture recipes and owners. Research only; no implementation changed. +- Added `docs/research/texture-formats.md`, an inventory of the texture formats and layouts BetterXen handles (#260). For BC1–BC7, RGBA8 and Depth32Float it separates container recognition, CPU decoding, layout conversion, native Metal upload and readback, translated sampling, the host-side D3D12-shaped API (called from Rust, not wired to guest imports) and guest reachability through imported services, and links each cell's implementing files and tests and each format's exact public specification sections, including the packed BC footprints from #241. It cross-references #208 and #209 instead of opening duplicate tasks, lists console layouts, console descriptors and asset or audio containers as unknowns, and ranks three proposed follow-ups with fixture recipes and owners. Research only; no implementation changed. - Rewrote the README around the six development phases and the first-launchable-application target (#311), with colour-coded Mermaid diagrams (system flow, milestone roadmap, CPU, runtime-service and shader-form charts built from the generated registries), badges, a repository overview, a contributing section and corrected texture-sampling wording. The older X1–X25 capability map is kept in a collapsible section. The diagrams were not render-tested locally. - Added a fast "Repository hygiene" check (`.github/workflows/hygiene.yml`, `scripts/audit/docs_hygiene.py`). It runs on Ubuntu without a Rust toolchain or network access and fails only on merge-conflict markers, broken relative Markdown links and invalid workflow YAML in tracked files. A separate advisory step warns, without failing, when source or script changes have no changelog entry. A local run over the 626 tracked files found no problems, and planted failures of each kind were caught; it has not yet run on GitHub. diff --git a/docs/research/texture-formats.md b/docs/research/texture-formats.md index 53843d1..2dc5d6e 100644 --- a/docs/research/texture-formats.md +++ b/docs/research/texture-formats.md @@ -11,26 +11,28 @@ A format can be handled at one stage and missing at the next. The columns below - **Layout**: converting between a stored memory layout and the row-major layout Metal expects. - **Native**: uploading to a Metal texture of that pixel format and reading it back on the GPU. - **Sampling**: a translated RDNA 2 image instruction reading the texture inside a shader. -- **Guest**: a guest program reaching the path through the project's D3D12-style graphics services. +- **Host graphics API**: the D3D12-shaped `GraphicsContext` entry points, exercised by tests that call them directly from Rust. [The interface contract](../interfaces.md#guest-texture-binding-descriptor-tables) states they are not yet wired to guest imports, so this column is not guest evidence. +- **Guest**: an original guest program (PE fixture) reaching the path through imported services, with a test that runs it. +- **Specification**: the public sections the implementation and its expected values cite. "—" means not implemented. "Rejected" means the input is refused with an error rather than handled. ## Formats -| Format | Container | CPU decode | Layout | Native | Sampling | Guest | -| --- | --- | --- | --- | --- | --- | --- | -| RGBA8 unorm | — | not needed | row-major mips, direct or budgeted staged upload (`crates/metal/src/texture_pipeline.rs`) | upload and render target (`render_rgba8*`, `crates/metal/tests/native/texture_sampling.rs`) | `image_sample_lz`, 2D, level 0 (`crates/isa/src/lib.rs`, `crates/metal/tests/native/translated_render.rs`) | one-level 2D SRV, `DXGI_FORMAT_R8G8B8A8_UNORM` (`crates/loader/src/graphics.rs`, `crates/loader/tests/graphics_textures.rs`) | -| BC1 | — | `decode_bc1` (`crates/texture/src/lib.rs`) | synthetic tiled layout, pitched uploads (`TiledBc1`, `Bc1Upload`) and per-subresource packed footprints (`BcTextureLayout`, `PackedBcUpload`) | `read_tiled_bc1`, `read_bc1_upload`, including packed footprints (`crates/metal/tests/native/texture.rs`, `crates/metal/tests/packed_bc_upload.rs`) | sampled by the translated `image_sample_lz` pixel stage (`render_rgba8_sampled_bc1`, `crates/metal/tests/native/translated_bc1.rs`) | one-level 2D SRV, `DXGI_FORMAT_BC1_UNORM` (same files as RGBA8) | -| BC2, BC3 | — | `decode_bc2`, `decode_bc3` (`crates/texture/src/bc.rs`, `crates/texture/tests/bc_formats.rs`) | pitched upload (`BcAlphaUpload`) and packed footprints | `read_bc_alpha_upload`, including packed footprints (`crates/metal/tests/native/texture_bc_alpha.rs`, `crates/metal/tests/packed_bc_upload.rs`) | — | — | -| BC4, BC5 (unorm, snorm) | — | `decode_bc4_*`, `decode_bc5_*` (`crates/texture/src/bc.rs`, `crates/texture/tests/bc_formats.rs`) | pitched upload (`BcChannelUpload`) and packed footprints | `read_bc_channel_upload`, including packed footprints (`crates/metal/tests/native/texture_bc_channel.rs`, `crates/metal/tests/packed_bc_upload.rs`) | — | — | -| BC6H (ufloat, sfloat) | — | single-subset modes only; two-subset modes rejected (`crates/texture/src/bc6h.rs`, `crates/texture/tests/bc6h.rs`) | packed footprints only, 16-byte blocks (`crates/texture/src/footprint.rs`) | — | — | — | -| BC7 unorm | — | all eight modes (`crates/texture/src/bc7.rs`, `crates/texture/tests/bc7.rs`) | packed footprints only, 16-byte blocks (`crates/texture/src/footprint.rs`) | — | — | — | -| BC7 sRGB | — | same bytes as BC7; the sRGB transfer function is outside the decoder | — | — | — | — | -| Depth32Float | — | not needed | render attachment | `render_depth` with depth readback (`crates/metal/tests/native/depth.rs`) | — | — | +| Format | Container | CPU decode | Layout | Native | Sampling | Host graphics API | Guest | Specification | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | +| RGBA8 unorm | — | not needed | row-major mips, direct or budgeted staged upload ([`crates/metal/src/texture_pipeline.rs`](../../crates/metal/src/texture_pipeline.rs)) | upload and render target (`render_rgba8*`, [`crates/metal/tests/native/texture_sampling.rs`](../../crates/metal/tests/native/texture_sampling.rs)) | `image_sample_lz`, 2D, level 0 ([`crates/isa/src/lib.rs`](../../crates/isa/src/lib.rs), [`crates/metal/tests/native/translated_render.rs`](../../crates/metal/tests/native/translated_render.rs)) | one-level 2D SRV, `DXGI_FORMAT_R8G8B8A8_UNORM`, called from Rust ([`crates/loader/src/graphics.rs`](../../crates/loader/src/graphics.rs), [`crates/loader/tests/graphics_textures.rs`](../../crates/loader/tests/graphics_textures.rs)) | synthetic `xenora.dll` texture services (`texture_create`, `texture_update`, `frame_submit_textured`, `texture_destroy`) driven by the Gate 5 original PE fixture ([`crates/ffi/src/lib.rs`](../../crates/ffi/src/lib.rs), test `textured_pe_fixture_executes_dynamic_updates_and_retirement` in [`crates/ffi/tests/resources.rs`](../../crates/ffi/tests/resources.rs)); not through the descriptor-table API | [`MTLPixelFormat.rgba8Unorm`](https://developer.apple.com/documentation/metal/mtlpixelformat/rgba8unorm) | +| BC1 | — | `decode_bc1` ([`crates/texture/src/lib.rs`](../../crates/texture/src/lib.rs)) | synthetic tiled layout, pitched uploads (`TiledBc1`, `Bc1Upload`) and per-subresource packed footprints (`BcTextureLayout`, `PackedBcUpload`) | `read_tiled_bc1`, `read_bc1_upload`, including packed footprints ([`crates/metal/tests/native/texture.rs`](../../crates/metal/tests/native/texture.rs), [`crates/metal/tests/packed_bc_upload.rs`](../../crates/metal/tests/packed_bc_upload.rs)) | sampled by the translated `image_sample_lz` pixel stage (`render_rgba8_sampled_bc1`, [`crates/metal/tests/native/translated_bc1.rs`](../../crates/metal/tests/native/translated_bc1.rs)) | one-level 2D SRV, `DXGI_FORMAT_BC1_UNORM`, called from Rust (same files as RGBA8) | — | [Khronos DFS 1.3, S3TC](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#S3TC) (BC1 with and without alpha); [Microsoft, BC1](https://learn.microsoft.com/en-us/windows/win32/direct3d11/texture-block-compression-in-direct3d-11) | +| BC2, BC3 | — | `decode_bc2`, `decode_bc3` ([`crates/texture/src/bc.rs`](../../crates/texture/src/bc.rs), [`crates/texture/tests/bc_formats.rs`](../../crates/texture/tests/bc_formats.rs)) | pitched upload (`BcAlphaUpload`) and packed footprints | `read_bc_alpha_upload`, including packed footprints ([`crates/metal/tests/native/texture_bc_alpha.rs`](../../crates/metal/tests/native/texture_bc_alpha.rs), [`crates/metal/tests/packed_bc_upload.rs`](../../crates/metal/tests/packed_bc_upload.rs)) | — | — | — | [Khronos DFS 1.3, S3TC BC2](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#s3tc_bc2) and [BC3](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#s3tc_bc3); [Microsoft, BC2 and BC3](https://learn.microsoft.com/en-us/windows/win32/direct3d11/texture-block-compression-in-direct3d-11) | +| BC4, BC5 (unorm, snorm) | — | `decode_bc4_*`, `decode_bc5_*` ([`crates/texture/src/bc.rs`](../../crates/texture/src/bc.rs), [`crates/texture/tests/bc_formats.rs`](../../crates/texture/tests/bc_formats.rs)) | pitched upload (`BcChannelUpload`) and packed footprints | `read_bc_channel_upload`, including packed footprints ([`crates/metal/tests/native/texture_bc_channel.rs`](../../crates/metal/tests/native/texture_bc_channel.rs), [`crates/metal/tests/packed_bc_upload.rs`](../../crates/metal/tests/packed_bc_upload.rs)) | — | — | — | [Khronos DFS 1.3, RGTC BC4](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#rgtc_bc4) and [BC5](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#rgtc_bc5); [Microsoft, BC4 and BC5](https://learn.microsoft.com/en-us/windows/win32/direct3d11/texture-block-compression-in-direct3d-11) | +| BC6H (ufloat, sfloat) | — | single-subset modes only; two-subset modes rejected ([`crates/texture/src/bc6h.rs`](../../crates/texture/src/bc6h.rs), [`crates/texture/tests/bc6h.rs`](../../crates/texture/tests/bc6h.rs), vectors [`crates/texture/tests/fixtures/bc6h_vectors.txt`](../../crates/texture/tests/fixtures/bc6h_vectors.txt)) | packed footprints only, 16-byte blocks ([`crates/texture/src/footprint.rs`](../../crates/texture/src/footprint.rs)) | — | — | — | — | [Khronos DFS 1.3, BPTC BC6H](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#bptc_bc6h) (section 20.2, Tables 121 and 122); [Microsoft, BC6H Format](https://learn.microsoft.com/en-us/windows/win32/direct3d11/bc6h-format) | +| BC7 unorm | — | all eight modes ([`crates/texture/src/bc7.rs`](../../crates/texture/src/bc7.rs), [`crates/texture/tests/bc7.rs`](../../crates/texture/tests/bc7.rs), vectors [`crates/texture/tests/fixtures/bc7_vectors.txt`](../../crates/texture/tests/fixtures/bc7_vectors.txt)) | packed footprints only, 16-byte blocks ([`crates/texture/src/footprint.rs`](../../crates/texture/src/footprint.rs)) | — | — | — | — | [Khronos DFS 1.3, BPTC BC7](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#bptc_bc7) (section 20.1, Tables 109–120); [Microsoft, BC7 Format](https://learn.microsoft.com/en-us/windows/win32/direct3d11/bc7-format) | +| BC7 sRGB | — | same bytes as BC7; the sRGB transfer function is outside the decoder | — | — | — | — | — | as BC7 | +| Depth32Float | — | not needed | render attachment | `render_depth` with depth readback ([`crates/metal/tests/native/depth.rs`](../../crates/metal/tests/native/depth.rs)) | — | — | — | [`MTLPixelFormat.depth32Float`](https://developer.apple.com/documentation/metal/mtlpixelformat/depth32float) | -Sampler state is limited to nearest filtering and clamp-to-edge addressing (`crates/texture/src/sampler.rs`). Other filter or address modes are rejected. +Sampler state is limited to nearest filtering and clamp-to-edge addressing ([`crates/texture/src/sampler.rs`](../../crates/texture/src/sampler.rs)). Other filter or address modes are rejected. -Native BC paths require `supportsBCTextureCompression`. A device without it fails as a capability error (`crates/metal/src/compute.rs`), separately from implementation failures. +Native BC paths require `supportsBCTextureCompression`. A device without it fails as a capability error ([`crates/metal/src/compute.rs`](../../crates/metal/src/compute.rs)), separately from implementation failures. Known source differences, recorded where they are implemented: @@ -41,11 +43,11 @@ Known source differences, recorded where they are implemented: | Layout | State | Where | | --- | --- | --- | -| Row-major RGBA8 mips | implemented | `crates/metal/src/texture_pipeline.rs` | -| Budgeted staged RGBA8 upload | implemented | `MetalRgba8Texture::upload_staged`, `crates/metal/src/texture_pipeline.rs` | -| Pitched, layer-major BC uploads (one pitch for every mip, padded slices) | implemented for BC1–BC5 | `crates/texture/src/upload.rs` | -| Per-subresource packed footprints for block-compressed mip chains (tight or aligned rows) | layout implemented for BC1–BC7; native readback covers BC1–BC5 (#241, PR #278) | `crates/texture/src/footprint.rs`, `crates/texture/tests/bc_footprint.rs`, `crates/metal/tests/packed_bc_upload.rs` | -| The synthetic 2×2-tile BC1 layout | implemented; defined by the project's fixtures, not by any console | `crates/texture/src/lib.rs` | +| Row-major RGBA8 mips | implemented | [`crates/metal/src/texture_pipeline.rs`](../../crates/metal/src/texture_pipeline.rs) | +| Budgeted staged RGBA8 upload | implemented | `MetalRgba8Texture::upload_staged`, [`crates/metal/src/texture_pipeline.rs`](../../crates/metal/src/texture_pipeline.rs) | +| Pitched, layer-major BC uploads (one pitch for every mip, padded slices) | implemented for BC1–BC5 | [`crates/texture/src/upload.rs`](../../crates/texture/src/upload.rs) | +| Per-subresource packed footprints for block-compressed mip chains (tight or aligned rows) | layout implemented for BC1–BC7; native readback covers BC1–BC5 (#241, PR #278) | [`crates/texture/src/footprint.rs`](../../crates/texture/src/footprint.rs), [`crates/texture/tests/bc_footprint.rs`](../../crates/texture/tests/bc_footprint.rs), [`crates/metal/tests/packed_bc_upload.rs`](../../crates/metal/tests/packed_bc_upload.rs) | +| The synthetic 2×2-tile BC1 layout | implemented; defined by the project's fixtures, not by any console | [`crates/texture/src/lib.rs`](../../crates/texture/src/lib.rs) | | Desktop RDNA 2 surface tiling (swizzle modes) | unknown; not researched in this repository | — | | Console texture memory layouts | unknown; no public source reviewed | — | @@ -53,10 +55,10 @@ Known source differences, recorded where they are implemented: These are the primary sources the implementations above cite. The format rows already name them in their source files. -- Khronos Data Format Specification 1.3: the S3TC section (BC1–BC3), the RGTC section (BC4, BC5), section 20.1 "BC7" and section 20.2 "BC6H". -- Microsoft Direct3D documentation: "Texture Block Compression in Direct3D 11", "Block Compression (Direct3D 10)", "BC6H Format" and "BC7 Format". These are used for the format definitions and DXGI format codes, not for console behaviour. -- Apple Metal documentation: `MTLPixelFormat` and `MTLDevice.supportsBCTextureCompression`, for the native pixel formats and the capability check. -- AMD "RDNA 2" Instruction Set Architecture reference guide (GPUOpen): MIMG instructions such as `image_sample_lz`, and the image resource and sampler descriptor formats. These cover desktop gfx1030 only. [Xbox GPU evidence](xbox-gpu.md) records why desktop statements do not transfer to the console without separate evidence. +- [Khronos Data Format Specification 1.3](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html): the [S3TC](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#S3TC) section (BC1–BC3), the [RGTC](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#RGTC) section (BC4, BC5), section 20.1 ["BC7"](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#bptc_bc7) and section 20.2 ["BC6H"](https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html#bptc_bc6h). +- Microsoft Direct3D documentation: ["Texture Block Compression in Direct3D 11"](https://learn.microsoft.com/en-us/windows/win32/direct3d11/texture-block-compression-in-direct3d-11), ["Block Compression (Direct3D 10)"](https://learn.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-block-compression), ["BC6H Format"](https://learn.microsoft.com/en-us/windows/win32/direct3d11/bc6h-format) and ["BC7 Format"](https://learn.microsoft.com/en-us/windows/win32/direct3d11/bc7-format). These are used for the format definitions and DXGI format codes, not for console behaviour. +- Apple Metal documentation: [`MTLPixelFormat`](https://developer.apple.com/documentation/metal/mtlpixelformat) and [`MTLDevice.supportsBCTextureCompression`](https://developer.apple.com/documentation/metal/mtldevice/supportsbctexturecompression), for the native pixel formats and the capability check. +- AMD "RDNA 2" Instruction Set Architecture reference guide ([GPUOpen architecture documentation](https://gpuopen.com/amd-gpu-architecture-programming-documentation/)): MIMG instructions such as `image_sample_lz`, and the image resource and sampler descriptor formats. These cover desktop gfx1030 only. [Xbox GPU evidence](xbox-gpu.md) records why desktop statements do not transfer to the console without separate evidence. ## Unknowns @@ -64,7 +66,7 @@ These are research questions, not missing features: - **Console texture memory layouts and tiling.** No public specification has been reviewed. Desktop RDNA 2 tiling would be a separate research note and would still not establish console behaviour. - **Console resource descriptor formats.** Unknown. See [Xbox GPU evidence](xbox-gpu.md), which lists descriptor layout among the unresolved items. -- **Asset and audio containers.** BetterXen parses none. The runtime's audio path accepts only raw PCM (`XENORA_AUDIO_FORMAT_PCM_S16LE` and `PCM_F32LE` in `crates/ffi/include/xenora.h`). No original workload has shown a need for a container or a compressed audio format. +- **Asset and audio containers.** BetterXen parses none. The runtime's audio path accepts only raw PCM (`XENORA_AUDIO_FORMAT_PCM_S16LE` and `PCM_F32LE` in [`crates/ffi/include/xenora.h`](../../crates/ffi/include/xenora.h)). No original workload has shown a need for a container or a compressed audio format. ## Follow-ups