Skip to content

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

Merged
JohnConnorNPC merged 3 commits into
R0Y00:mainfrom
Leyukaka:shader-mesh-guest-root
Nov 29, 2026
Merged

JohnConnorNPC merged 3 commits into
R0Y00:mainfrom
Leyukaka:shader-mesh-guest-root

Conversation

@Leyukaka

@Leyukaka Leyukaka commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #3416

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 1a0120b).
  • 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

@Leyukaka
Leyukaka force-pushed the shader-mesh-guest-root branch from e3baeee to 3ba4884 Compare November 29, 2026 10:28
@JohnConnorNPC
JohnConnorNPC merged commit f4e2e5c into R0Y00:main Nov 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants