Repository navigation
Link over-budget mesh outputs to the paired pixel shader on macOS - #161
Conversation
…ipelines Port Texbirds' Marvisak/VIctory#2398 to the macOS runtime. Preserve the runtime compiler options and limit container retention to the experimental path. Co-authored-by: Tex <kwintjanleenders@gmail.com>
|
Thanks for the careful measurements. This overlaps #153 (same 32 KiB limit, same helper, different size formula) and conflicts with #180 and #164 in lower.rs and emit/mod.rs. Please settle one shared mesh output size helper with #153 (the 4 bytes per component times exact vertex count measured on D3DMetal, or justify the round up to 32), say whether the always-on count tightening should also be opt-in, run cargo fmt on the new code, and rebase. |
The size now comes from the shared mesh_outputs helper (4 bytes per component times the exact vertex count) and Metal's limit, and the duplicate 32-rounded helper and limit are gone. The count tightening stays on for any shader over the limit, since each lane exports one vertex and one primitive.
|
I merged main into this branch and merged it. The paired mesh and pixel linking now uses the shared helper from #153 ( |
This backports Texbirds’ paired mesh and pixel shader translation to the macOS runtime. Related to #132 and the footprint measurements in #153.
For over-budget shaders, the translator first caps the declared vertex and primitive counts at the number of exporting lanes. If the standalone shader still exceeds 32 KiB, setting
VICTORY_LINK_MESH_OUTPUTS=1enables a second translation using the actual pixel shader’s input reads. Both stages keep the system values they need. Results are cached by the full source hashes. Each translation inherits the runtime's Wine options. Pairing is opt-in. The standalone count tightening applies in both modes.The native workspace passed 457 tests. The release Windows build completed, and the shader suite passed 280 tests under CrossOver Preview and D3DMetal on an M5 Max, with three ignored. The synthetic mesh/pixel test checks the rendered color by readback.
In a separate integration build with the same linking algorithm, I exercised all 66 distinct shader-pack pairs found for six affected character shader names. Forty-four standalone mesh shaders across these pairs failed DXIL validation. Both stages of all 66 linked pairs validated and created a hardware pipeline. Two over-budget pairs also linked during a live prologue run, each at 28,672 bytes. The scene remained overexposed. The capture interval from world frame +48 to +90 ran at 0.58 FPS with linking versus 0.71 FPS in an earlier baseline run. Those single runs had different shader-cache and background compilation conditions. This change addresses pipeline correctness. Its gameplay FPS benefit is unproven.
The repository tests use generated shaders.