tombox-xshader: generate the pass-through hull shader for tessellation #312
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!312
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/312/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?
@nickfmbg on GitHub · 2026-11-23 17:36 UTC · original
nickfmbg:tess-hs-passthrough→main· +988 −7 · 10 files · 3 commits · closed without mergingLibrary / area:
tombox-xshader: newtess_abi.rs, plushlsl/tess.rs(passthrough_hull,Partitioning,PASSTHROUGH_VS, sharedpatch_struct),tests/tess.rs, and adocs/BLOCKERS.mdentry.Exports changed (exports.txt rows): None.
Source of the behaviour:
src/amd/common/nir/ac_nir_lower_tess_io_to_mem.c(MIT). Inhs_store_tess_factors_for_tessellator, the factors of a patch are attf_offset + rel_patch_id * (outer + inner) * 4: triangles as outer[0..3] then inner, quads as outer[0..4] then inner[0..2], and isolines with GL's outer[1] before outer[0]. GFX6–8 adds a 4-byte base, becausehs_store_dynamic_control_word_gfx6writes0x80000000at the start of the ring. The fixed-function tessellator reads this layout, so it is the same whichever compiler wrote the HS.Step 3a of #294, stacked on #301, which is stacked on #295. Only the last commit is new here.
What it does
passthrough_hull(hs, ds, partitioning, layout)returns a PC hull shader plus its vertex shader, for the pipeline in the #294 design (the console HS runs elsewhere and writes the TF ring).tb_patch_offset + SV_PrimitiveIDfromtb_tfat the hardware offsets above.tess_abi.rs:tb_tfis t0 and theTbTessroot constants (tb_tf_offset,tb_patch_offset) are b0, both in a new internal space, 4000006. It also has the offset helpers d3d12_xs will use.patch_structnow takes the domain. It always declares the domain's fullSV_TessFactor/SV_InsideTessFactorarrays, so the hull and domain shaders produce the same patch struct even when the console DS declared only some factors. Domain shader output for the step-2 cases is unchanged.Not in this PR
All four are recorded in the new BLOCKERS entry.
Tests (
tests/tess.rs, 6 new)GPU (WARP):
SV_PrimitiveID.SV_DomainLocationto a UAV: ring (3, 2) gives lines at v = 0 and 0.5 with 4 points each.Mutation checks, done locally: a wrong patch stride, a dropped GFX6–8 shift and reversed factor order each make a GPU test fail.
Generated text for the quad/GFX6–8 and tri/GFX9+ cases, and DXC compilation for all 3 domains × 4 partitionings × 2 layouts.
Refusals: a non-hull TessInfo, a domain mismatch, a control-point mismatch, invalid output topologies, a DS without tess info, and a non-domain stage.
cargo test -p tombox-xshaderpassesNo game or console files and no binaries included
No fake success; anything not possible is left
missingwith a note🤖 Generated with Claude Code
@MeNoSkills on GitHub · 2026-11-23 19:21 UTC · original
Independent run of this PR's
tests/tess.rs(11 tests) on an RTX 4070 Ti (Windows 10 19045) and on WARP, release build: 11 passed, 0 failed on both, includinggpu_translated_domain_shader_matches_native_hlsl_on_a_tessellated_quad,gpu_passthrough_hull_takes_each_patch_factors_from_the_ring,gpu_passthrough_hull_honours_the_gfx6_control_word_and_both_offsetsandgpu_isoline_ring_dword0_is_line_detail_and_dword1_is_line_density.tests/synthetic.rspasses 24/24 on WARP and hardware with the touched lines.tests/mesh.rspasses 24/24 withTOMBOX_EXEC_HW=1; on this machine's WARP its GPU tests fail with "WARP reports MeshShaderTier 0", which is the same on unmodified main (older WARP has no mesh support).@omonkeyz on GitHub · 2026-11-25 13:49 UTC · original
Applied on main in
aac1f6e(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed