upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authoraslan2142 <jan.trencansky@protonmail.com>2026-11-25 14:28:49 +0100
committerGitHub <noreply@github.com>2026-11-25 14:28:49 +0100
commit5e95fa2f46d5df1a8397d5ee871add369031d8b6 (patch)
treef1bf9b346a528eb3501ce324b6a388d2f396246d /docs
parent384abe5b06d08e349f4b4e4394c68f036da47dc7 (diff)
parent668d65b4b9cb74586176edb97a9379231153e4ff (diff)
Merge pull request #1671 from OreoFR/rt-slot57-blend-state
d3d12_xs: blend state for slot 57 native pipelines from state blob A (RT-SLOT57-BLEND-STATE)
Diffstat (limited to 'docs')
-rw-r--r--docs/fspx.md47
1 files changed, 45 insertions, 2 deletions
diff --git a/docs/fspx.md b/docs/fspx.md
index 6fa4a4c8d..53521ad41 100644
--- a/docs/fspx.md
+++ b/docs/fspx.md
@@ -276,12 +276,55 @@ title calls device slot 57 (`+0x1c8`) with `IID_ID3D12PipelineState` (`{765a30f3
276 - `state blob`: `+0x000` version tag (`0x4005d800` in 15,632 records, `0x4005d808` in 9,159, `0x4005d810` in 6), 276 - `state blob`: `+0x000` version tag (`0x4005d800` in 15,632 records, `0x4005d808` in 9,159, `0x4005d810` in 6),
277 `+0x004` family (`4` in 12,735 or `6` in 12,062), `+0x02c = 2`, `+0x07c` (`0xcc0010` / `0` / `0xcc0011`), 277 `+0x004` family (`4` in 12,735 or `6` in 12,062), `+0x02c = 2`, `+0x07c` (`0xcc0010` / `0` / `0xcc0011`),
278 `+0x0f4 = 5`, `+0x0f8 = 1`, `+0x0fc = 0x33333333` (`0.1f`), `+0x100..+0x11c` (`0x00060006` x8), `+0x150 = 0x40`, 278 `+0x0f4 = 5`, `+0x0f8 = 1`, `+0x0fc = 0x33333333` (`0.1f`), `+0x100..+0x11c` (`0x00060006` x8), `+0x150 = 0x40`,
279 `+0x158 = 0xffffffff`, `+0x17c = 0x10000a00`. Unidentified offsets are logged once per offset while safe default 279 `+0x158 = 0xffffffff`, `+0x17c = 0x10000a00`. The colour-target registers are decoded (next paragraph); raster
280 raster/depth/blend state is used. 280 and depth state are not, and keep the factory's defaults.
281 - `stage blob`: `+0x00 = 2` (graphics stage blob), `+0x04` payload size (`196` in 208 B blobs), `+0x08 = 0x66`, 281 - `stage blob`: `+0x00 = 2` (graphics stage blob), `+0x04` payload size (`196` in 208 B blobs), `+0x08 = 0x66`,
282 `+0x0c = 0x40 | flags`, followed by records `0x41` (32 B input/output signature), `0x42` (32 B output signature) 282 `+0x0c = 0x40 | flags`, followed by records `0x41` (32 B input/output signature), `0x42` (32 B output signature)
283 and `0x43` (20 B: tag + 16 B opaque digest). 283 and `0x43` (20 B: tag + 16 B opaque digest).
284 284
285**State blob A: the colour-target registers (RT-SLOT57-BLEND-STATE).** Blob A is the console driver's serialized
286pipeline state, and its shared block holds context register values in the RDNA2 layout (Mesa's gfx10 register
287headers). Measured on 1.0.2.1 over all 5,680 distinct blobs, which the 25,471 graphics records reference:
288
289- **Shape:** 380 + 8k bytes (k = 0..5) for vertex-shader pipelines, and 464 + 8k (k = 0..7) for mesh pipelines. The
290 mesh pipelines' stage block is 84 bytes longer, so every offset after `+0x28` moves by 84 there; the offsets below
291 are the vertex ones. Word 0 is `0x4005d800` with bits 3 and 4 free in all 25,471 records.
292- **`+0x78` `CB_TARGET_MASK`:** four component bits (R, G, B, A, as in `D3D12_COLOR_WRITE_ENABLE`) per target:
293 `0xf` in 16,650 records, `0xff` in 2,805, `0xffffff` in 2,561. In 17,626 records the targets it enables are exactly
294 `0..rt_count-1` of blob B. In 1,937 it also enables target 1 of a one-target pipeline: those are the dual-source
295 pipelines below. The others leave a target with a format unwritten.
296- **`+0x7c` `CB_COLOR_CONTROL`:** ROP3 `0xcc` (copy) in every record, so no logic op.
297- **`+0xd0..+0xec` `CB_BLEND0..7_CONTROL`:** one word per target. There are 34 distinct values, every one an
298 in-range RDNA2 blend: factors 0 to 20 with neither `BOTH_*` value, `COMB_FCN` 0 to 4, `SEPARATE_ALPHA_BLEND` set
299 wherever `ENABLE` is, and `DISABLE_ROP3` set in all. By target 0: `0x80000000` (blending off) in 15,373 records,
300 `0xe5010504` (colour `SRC_ALPHA`/`INV_SRC_ALPHA`, alpha `ONE`/`INV_SRC_ALPHA`) in 3,456, `0xf1010f01` (colour
301 `ONE`/`SRC1_COLOR`, alpha `ONE`/`SRC1_ALPHA`) in 1,931, and `0xe5040504` in 1,387. 10,135 records blend on at least
302 one of their targets.
303- **`+0x100..+0x11c`:** eight more per-target words that follow `CB_BLENDn` (`0x06000600` where blending is off).
304 They fit `SX_MRTn_BLEND_OPT`, whose `COMB_FCN` 6 is "blend disabled". They aren't read.
305
306`runtime/src/native_pso.h` (`decode_state_a_blend`, `d3d12_blend`) maps each target's `CB_BLENDn_CONTROL` and
307`CB_TARGET_MASK` nibble to a `D3D12_RENDER_TARGET_BLEND_DESC`, and `fill_blend_state` in
308`runtime/shims/d3d12_xs_native_pso.h` uses it for every native PSO:
309
310- **Before:** every target had blending off and wrote every component, so the first-run pages after #939 drew glyph
311 quads solid, artwork hard-edged and composited backgrounds black.
312- **With the decoded state:** the pages, the legal screens and the loading slideshow draw as on console (RTX 4070
313 Laptop).
314- **Integer targets:** a target with a `UINT` or `SINT` format never blends, as the colour block bypasses blending
315 there and D3D12 refuses a PSO that asks for it. One library pipeline enables `MAX` on an `R8_UINT` target beside
316 two others.
317- **Stand-in targets:** where `B4G4R4A4_UNORM` is not renderable, the Vulkan layer draws it into an RGBA8 stand-in
318 and refuses blending there (`E_NOTIMPL`, the output is quantized before it). The factory then retries the pipeline
319 with blending off on those targets only (`shims/d3d12_xs_native_pso_fallback.h`), instead of leaving it to the PC
320 description path. On an RTX 4070 Laptop that is the same library pipeline (the first one the title creates). Only a
321 pipeline that blends a `B4G4R4A4` target is retried: `E_NOTIMPL` also stands for refusals unrelated to blending (a
322 rect list without its geometry stage, mesh limits, `FullyCovered`, a dual-source output that does not fit
323 `Location 0, Index 1`), and those keep the blend the title asked for.
324- **Kept on the defaults:** the 1,937 records that blend with the dual-source `SRC1` factors, because the translator
325 declares no second pixel-shader output. A blob of another shape, or a target with a factor this path does not
326 take, keeps the whole pipeline on the defaults and is logged.
327
285## Translation status 328## Translation status
286 329
287In wave64, VALU compares and carry outputs write both predicate words. Conditional selects and carry inputs 330In wave64, VALU compares and carry outputs write both predicate words. Conditional selects and carry inputs