shader: infer descriptor table bindings for mesh shaders without RTS0 #129
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/129"
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?
Imported from omonkeyz/xbox-emulator. Originally posted by ComputerScape04 on 2026-11-22T14:04:50Z.
Summary
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.Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-22T14:59:19Z.
Review: CHANGES_REQUESTED
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.Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-22T15:45:01Z.
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.
Imported from omonkeyz/xbox-emulator. Originally posted by MeNoSkills on 2026-11-22T16:07:32Z.
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).
Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-22T17:34:19Z.
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).Pull request closed