shader: lower mesh param0..param12 exports and gfx2hlsl pixel linkage #2419
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2427"
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 R0Y00/Xbox2Windows. Originally posted by R0D4X on 2026-11-25T16:26:50Z.
Summary
param12and their pairing with the pixel stage inputs) across the bounded mesh translators andgfx2hlsl.py.tools/mesh_param_link.py(MAX_PARAM = 12per AMD RDNA 2 ISA §10.2EXPtarget32 + N,MAX_VERTEX_VECTORS = 32per D3D12 SM 6.5 vertex output limit) withParamLinkage,validate_linkage,merge_wave_params,hlsl_param_fields, andhlsl_param_writes(densePARAM0..PARAM12,nointerpolation uint4 FPARAM*,HPARAML*/HPARAMH*binary16 halves, and zero-initialized unexported gap slots), preserving legacyTEXCOORD0forparam0-only callers without an explicitParamLinkage.tools/mesh_entry_aot.pyandtools/mesh_dynamic_aot.pyto decode and validateexp param0..exp param12across waves and dynamic variants (keeping CLI__main__untouched to avoid overlap with #2394/#2407).MeshPixelStage(Pipeline)(sharingPipeline._init_pixel_context()) andmesh_plain_paramshandling intools/startup/gfx2hlsl.pyto translate paired pixel shaders (linear, flatv_interp_mov_f32 p0, plain-32-bitv_interp_p1ll_f16/v_interp_p2_f16, and depth-only stages) and validate attribute coverage against the mesh exports.tests/mesh_param_link_check.py, registermesh_param_link_{controls,warp,hardware}inCMakeLists.txt, and wiretests/mesh_param_link_check.pyintopixel-binary(llvm-mc-15) andpython-linuxin.github/workflows/windows.yml.Refs #2413, #1998
Verification
7092683a(upstream/main)8f995344(feat/mesh-param12-linkage)26300.9974), DXC1.9.2602.17Microsoft Basic Render Driver(1414:008c), driver10.0.26100.9818, D3D12 debug layer enabledNVIDIA GeForce RTX 5080(10de:2c02), driver32.0.16.2124, D3D12 debug layer enabledCommands and Observed Results
docs_links_check.py: 19 files / 464 links;bidi_controls_check.py: 1723 files;git diff --check: clean).MAX_PARAM = 12->15intools/mesh_param_link.py): caught (rc=1) and reverted cleanly.dev: 6 passed, 0 skipped, 0 failed (startup_tools_lint0.15 s,mesh_param_link_controls0.44 s,mesh_attribute_draw_hardware2.37 s,mesh_param_link_hardware2.71 s,mesh_attribute_draw_warp0.87 s,mesh_param_link_warp1.11 s;debug_errors=0 debug_warnings=0, all 5ms_6_5+ps_6_0drawspixels=1024 mismatches=0, both GPU negative controls caught at 992 and 1024 mismatched pixels).release: 3 passed, 0 skipped, 0 failed (controls0.44 s,hardware2.31 s,warp1.10 s;debug_errors=0 debug_warnings=0).tests/mesh_param_link_check.py binary llvm-mc-15was not run locally (llvm-mcis not installed on this Windows host) and is wired into the Ubuntupixel-binaryCI job.param0..param12export andMeshPixelStagepixel pairing in isolation; they do not establish full-game startup or slot-57 runtimeDispatchMeshforwarding.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:24:10Z.
Review: COMMENTED
Review of head
8f995344(comment only).Result: code looks sound. Not merged by us yet because the branch is 60 commits behind main (limit 20).
Checked:
tools/mesh_param_link.py: slot range 0..12, flat and binary16 slots must be exported, 32-vector limit, per-wave merge requires every slot to cover every vertex. LegacyTEXCOORD0path for param0-only callers is kept.gfx2hlsl.py:_init_pixel_contextsplit keeps thePipeline.__init__behaviour.MeshPixelStagerejects pixel reads of attributes the mesh stage does not export, and binary16 reads of non-plain slots.windows.ymladditions wire the new check intopixel-binaryandpython-linux. No other open or merged PR covers this slice (search "param12 mesh").Commands run locally on this head:
python3 tests/mesh_param_link_check.py-> passedpython3 tests/docs_links_check.py-> passedpython3 tests/bidi_controls_check.py-> passedgit diff --check origin/main...HEAD-> cleanMAX_PARAM = 13-> the test fails (range control).Not verified here: the D3D12 WARP draw readback (
mesh_param_link_warp/_hardware) only runs on Windows. We did not run it on this head.Next step for the author: merge or update the branch with main (60 behind), then re-check CI. After that a merger can run Win2025 dev+release on the new head.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T07:14:12Z.
Review: APPROVED
Reconciled the shared initialization with current main, including descriptor-write state and the separate main MeshPipeline. The original checks are registered through the current CTest and Linux fragments. Windows Release passed 11 of 11 with no skips, including param0 through param12 draw and negative controls on WARP and RTX 4060 Laptop, plus the existing clip/cull, dynamic mesh, entry and vertex-fetch cases.