tombox-xshader: parse PSV0 hull and domain runtime info #295

Closed
github-bot wants to merge 1 commit from gh-pr/295/head into gh-pr/295/base
Owner

@⁠nickfmbg on GitHub · 2026-11-23 16:39 UTC · original
nickfmbg:tess-hs-ds → main · +119 −5 · 4 files · 1 commits · closed without merging

Library / area: tombox-xshader (meta.rs: new TessInfo, parse_psv0_tess, GsInfo::tess). Literal GsInfo constructions in dxil_meta.rs, tests/mesh.rs and tests/synthetic.rs get tess: None.

Exports changed (exports.txt rows): None.

Source of the behaviour: the DXIL container's PSVRuntimeInfo0/1 layout in DirectXShaderCompiler (DxilPipelineStateValidation.h): the HSInfo union {InputControlPointCount, OutputControlPointCount, TessellatorDomain, TessellatorOutputPrimitive}, the DSInfo union {InputControlPointCount, OutputPositionPresent (u8), TessellatorDomain} (domain at +8 after alignment), ShaderStage at +24, and SigPatchConstOrPrimVectors at +26.

Step 1 of the tessellation plan in #294. It only adds metadata; Hull and Domain still return stage ... not supported yet. The patch constant signature already lands in ShaderExtract::prim_sig (PSG1), so it isn't added again.

Validation: control point counts 1..=32, domain 1..=3 (isoline, tri, quad), hull output primitive 1..=4. Anything else, any other stage, or a runtime info shorter than 27 bytes gives None.

Tests (meta::tests): hull and domain decoding, the domain's output-position byte, refusal of other stages and out-of-range fields, and parse_psv0_gs carrying tess for a hull shader and None for a vertex shader.

  • cargo test -p tombox-xshader passes (--lib, --test synthetic, --test mesh: 120 + 24 + 24 passed, run on Windows 11 / MSVC)
  • No game or console files and no binaries included
  • No fake success; anything not possible is left missing with a note

🤖 Generated with Claude Code

**@⁠nickfmbg** on GitHub · 2026-11-23 16:39 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/295) `nickfmbg:tess-hs-ds` → `main` · +119 −5 · 4 files · 1 commits · closed without merging **Library / area:** `tombox-xshader` (`meta.rs`: new `TessInfo`, `parse_psv0_tess`, `GsInfo::tess`). Literal `GsInfo` constructions in `dxil_meta.rs`, `tests/mesh.rs` and `tests/synthetic.rs` get `tess: None`. **Exports changed (exports.txt rows):** None. **Source of the behaviour:** the DXIL container's `PSVRuntimeInfo0/1` layout in DirectXShaderCompiler (`DxilPipelineStateValidation.h`): the `HSInfo` union `{InputControlPointCount, OutputControlPointCount, TessellatorDomain, TessellatorOutputPrimitive}`, the `DSInfo` union `{InputControlPointCount, OutputPositionPresent (u8), TessellatorDomain}` (domain at +8 after alignment), `ShaderStage` at +24, and `SigPatchConstOrPrimVectors` at +26. Step 1 of the tessellation plan in #294. It only adds metadata; Hull and Domain still return `stage ... not supported yet`. The patch constant signature already lands in `ShaderExtract::prim_sig` (PSG1), so it isn't added again. Validation: control point counts 1..=32, domain 1..=3 (isoline, tri, quad), hull output primitive 1..=4. Anything else, any other stage, or a runtime info shorter than 27 bytes gives `None`. Tests (`meta::tests`): hull and domain decoding, the domain's output-position byte, refusal of other stages and out-of-range fields, and `parse_psv0_gs` carrying `tess` for a hull shader and `None` for a vertex shader. - [x] `cargo test -p tombox-xshader` passes (`--lib`, `--test synthetic`, `--test mesh`: 120 + 24 + 24 passed, run on Windows 11 / MSVC) - [x] No game or console files and no binaries included - [x] No fake success; anything not possible is left `missing` with a note 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Read the PSVRuntimeInfo hull union (input and output control points,
tessellator domain, output primitive) and domain union (input control
points, output-position byte, domain at the aligned +8), plus the
patch-constant vector count at +26, into GsInfo::tess. Out-of-range
fields and other stages give None. No translation behaviour changes;
step 1 of the tessellation plan in #294.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:17:37 +00:00
github-bot closed this pull request 2026-11-26 06:17:37 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:48 UTC · original

Applied on main in b5c3e14 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:48 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/295#issuecomment-7164326044) Applied on main in b5c3e14 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.