shader: derive mesh entry root inputs from the creation root signature #3448

Manually merged
github merged 3 commits from github-bot/gh-3446 into main 2026-11-29 12:10:06 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-29 09:32 UTC · original
Leyukaka:shader-mesh-guest-root → main · +182 −36 · 6 files · 3 commits · merged 2026-11-29 12:06 UTC

Part of #3418

What changes

  • walk_raw_graphics_root factors out the SGPR walk from read_raw_graphics. Vertex and pixel stages start at s8 as before; the mesh stage starts at s16. Every parameter consumes its slots in signature order (table 1, constants N, root descriptor 2), then the resource heap SGPR.
  • derive_mesh_root_mapping maps descriptor tables, root constants and root SRVs visible to ALL or MESH, plus the directly indexed resource heap SGPR. Root CBVs and UAVs consume two slots each and stay unmapped. The sampler heap is not mapped for mesh.
  • derive_mesh_root_mapping refuses a guest root with DENY_MESH_SHADER_ROOT_ACCESS before any binding is derived (guest root denies mesh shader root access).
  • compile_dxil: a new .mslayout line guest_root derives the root inputs from the request's sibling serialized 1.1 .root. It is refused when repeated (duplicate guest_root) and when combined with table, constants, root_address or resource_heap in either order (guest_root excludes explicit root mapping lines).
  • docs/experiments/native-fixed-mesh57.md documents the line.

Evidence

Release preset: native_direct_mesh and native_compile_dxil_refusals pass (2/2).

Mutations (reverted after each run):

  • Skip the derivation (if (raw.guest_root) -> if (false && raw.guest_root)): both tests fail.
    • native_direct_mesh at derived-mesh-root: native compute +0x8: mesh scalar memory needs a verified guest root mapping: s_load_dwordx4
    • native_compile_dxil_refusals at check_mesh_report(...): {'examined': 5, 'no_refusal': 1, 'refused': 4, ...}
  • Remove the explicit-then-guest_root refusal: native_direct_mesh fails at conflicting-mesh-root-* (the compile succeeds). native_compile_dxil_refusals still passes; it does not cover this refusal.
  • Remove the deny-flag refusal, or test DENY_AMPLIFICATION_SHADER_ROOT_ACCESS instead: native_direct_mesh fails at deny-mesh-root-access (the compile succeeds).

Not covered

  • The pr test preset does not run native_direct_mesh or native_compile_dxil_refusals (not in its filter on 1a0120ba).
  • Root CBVs and UAVs on the mesh stage remain unmapped.
  • Runtime preparation is unchanged and still uses the reviewed profile.
  • Already the case on main, not introduced here:
    • An explicit mapping (table, constants, root_address) is still accepted with a root that has DENY_MESH_SHADER_ROOT_ACCESS; only guest_root checks the flag.
    • The offline path accepts a non-indexed table read whose slot is outside the table's declared descriptor ranges. Only runtime preparation refuses it (MS buffer slot outside a verified SRV range).

Merge notes

  • Based on e358cf5f, which includes #3445, #3446 and #3447.
  • git merge-tree is clean against main 20bd1553 and #3441 (6193c5a5).
**@⁠Leyukaka** on GitHub · 2026-11-29 09:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3446) `Leyukaka:shader-mesh-guest-root` → `main` · +182 −36 · 6 files · 3 commits · merged 2026-11-29 12:06 UTC Part of #3418 ## What changes - `walk_raw_graphics_root` factors out the SGPR walk from `read_raw_graphics`. Vertex and pixel stages start at s8 as before; the mesh stage starts at s16. Every parameter consumes its slots in signature order (table 1, constants N, root descriptor 2), then the resource heap SGPR. - `derive_mesh_root_mapping` maps descriptor tables, root constants and root SRVs visible to ALL or MESH, plus the directly indexed resource heap SGPR. Root CBVs and UAVs consume two slots each and stay unmapped. The sampler heap is not mapped for mesh. - `derive_mesh_root_mapping` refuses a guest root with `DENY_MESH_SHADER_ROOT_ACCESS` before any binding is derived (`guest root denies mesh shader root access`). - `compile_dxil`: a new `.mslayout` line `guest_root` derives the root inputs from the request's sibling serialized 1.1 `.root`. It is refused when repeated (`duplicate guest_root`) and when combined with `table`, `constants`, `root_address` or `resource_heap` in either order (`guest_root excludes explicit root mapping lines`). - `docs/experiments/native-fixed-mesh57.md` documents the line. ## Evidence Release preset: `native_direct_mesh` and `native_compile_dxil_refusals` pass (2/2). Mutations (reverted after each run): - Skip the derivation (`if (raw.guest_root)` -> `if (false && raw.guest_root)`): both tests fail. - `native_direct_mesh` at `derived-mesh-root`: `native compute +0x8: mesh scalar memory needs a verified guest root mapping: s_load_dwordx4` - `native_compile_dxil_refusals` at `check_mesh_report(...)`: `{'examined': 5, 'no_refusal': 1, 'refused': 4, ...}` - Remove the explicit-then-`guest_root` refusal: `native_direct_mesh` fails at `conflicting-mesh-root-*` (the compile succeeds). `native_compile_dxil_refusals` still passes; it does not cover this refusal. - Remove the deny-flag refusal, or test `DENY_AMPLIFICATION_SHADER_ROOT_ACCESS` instead: `native_direct_mesh` fails at `deny-mesh-root-access` (the compile succeeds). ## Not covered - The `pr` test preset does not run `native_direct_mesh` or `native_compile_dxil_refusals` (not in its filter on 1a0120ba). - Root CBVs and UAVs on the mesh stage remain unmapped. - Runtime preparation is unchanged and still uses the reviewed profile. - Already the case on main, not introduced here: - An explicit mapping (`table`, `constants`, `root_address`) is still accepted with a root that has `DENY_MESH_SHADER_ROOT_ACCESS`; only `guest_root` checks the flag. - The offline path accepts a non-indexed table read whose slot is outside the table's declared descriptor ranges. Only runtime preparation refuses it (`MS buffer slot outside a verified SRV range`). ## Merge notes - Based on `e358cf5f`, which includes #3445, #3446 and #3447. - `git merge-tree` is clean against main `20bd1553` and #3441 (`6193c5a5`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 09:34:09 +00:00
github-bot force-pushed github-bot/gh-3446 from e3baeee6ad to 3ba4884a6c 2026-11-29 10:32:09 +00:00 Compare
github manually merged commit f4e2e5c60b into main 2026-11-29 12:10:06 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.