shader: infer descriptor table bindings for mesh shaders without RTS0 #129
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!129
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/129/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ComputerScape04 on GitHub · 2026-11-22 14:04 UTC · original
ComputerScape04:feature/infer-mesh-root-sig→main· +520 −22 · 15 files · 2 commits · closed without mergingSummary
Per the design settled in #142, this is Part 1 of the root signature inference work, providing the shared inference core for shaders lacking an embedded
RTS0chunk (such as console mesh programs):crates/tombox-xshader/src/hlsl/infer.rsbesiderootmem.rs. Translator caller files (d3d12_xs,bin/xshader.rs,bin/xshader_prelaunch.rs) are untouched.RTS0remains default. Inference only executes whenex.root_sig.is_none() && !ex.has_root_sigunderTOMBOX_INFER_ROOT_SIG=1or viatranslate_with_inference().s_mov_b32/s_mov_b64).t#/u#/s#).PSV0resource metadata when present.Tests
mesh_root_signature_inference_binds_scalar_buffer_load: Verifies scalar load inference, root CBV placement, and successful DXIL bytecode compilation via DXC.mesh_root_signature_inference_binds_typed_buffer_table: Verifies descriptor table range deduction and DXC compilation.mesh_root_signature_inference_matches_psv_metadata: Verifies descriptor table alignment withPSV0metadata.Scope
crates/tombox-xshader/.main.@omonkeyz on GitHub · 2026-11-22 15:45 UTC · original
Thanks for the update, there's a lot of good work here! Since then we've settled the direction for shaders without RTS0 in #142, and this PR should fold into that design:
hlsl/rootmem.rs, or a module beside it, not spread across the existing translator files.Please also cherry-pick or rebase each piece onto current main.
@MeNoSkills on GitHub · 2026-11-22 16:07 UTC · original
Ran this on real hardware: NVIDIA GeForce RTX 4070 Ti, Windows 10 19045, MSVC toolchain, branch head 89269fe, TOMBOX_EXEC_HW=1 (WARP reports MeshShaderTier 0, so the gpu_mesh_* tests need the hardware device).
I only ran the tests, I did not review the inference logic itself or run it on real mesh shaders (no dump).
@omonkeyz on GitHub · 2026-11-22 17:34 UTC · original
Applied in
c697a1e(merged in444014d) with your authorship kept, thanks. It stays opt-in. With TOMBOX_INFER_ROOT_SIG unset, translation and the shader-pack key are identical to main. With it set, d3d12_xs bypasses the pre-translate pack index (a11d361), so a shader translated with inference is never served from a pack built without it. The merge note records MeNoSkills' RTX 4070 Ti run (--test mesh 23 passed vs 20 on main).@omonkeyz on GitHub · 2026-11-22 14:59 UTC · original · requested changes
Thanks! Two separate things here, so please split them:
third_party/opusshould fail with a clear message (or the crate should be left out of the build), not ship an empty DLL.match_resourcefalls back to(default_reg, 0)when no PSV resource matches. That silently binds a guessed register and space. Please return an error in that case, so the translation refuses instead of binding the wrong resource. Also gatetranslate_with_inferencethe same way astranslate_linked(or make it the only entry point), so inference never runs unless asked for. Then a maintainer will run it against the stripped-mesh corpus on hardware.Pull request closed