fix(shader): follow a half kept below a zeroed word #241
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/241"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by ShadyUnderLight on 2026-11-27T03:36:09Z.
What this changes
One pipeline at the world frame was refused by Metal Shader Converter:
Its vertex program writes parameter 5 as a half and then zeroes the word a lane does not export:
packed_paramsjudges a parameter by the sources of the values it exports, but read that last write on its own: a literal 0, plain, so the parameter got noHALF10/HALF11rows. The pixel program interpolatesattr5.xwithv_interp_p1ll_f16and so readsHALF10; with no such output the pair does not link and every draw of the pipeline is dropped.A write to part of a dword that preserves the other bits now follows the value it keeps as well: the bits under the zeroed word are the half.
docs/native-host.mdrecords the rule and the refusal it explains.The pair only reached this check after #239 taught the converter dual-source blending; the two changes are independent.
One side effect worth knowing: a guessed container's hash covers its inferred signatures, so the vertex programs affected get new hashes and are translated once more.
How it was tested
cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory— 379 passed, 0 failedcargo test -p victory-shader— 306 passed, 0 failedcargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings— clean;cargo xtask policy— 369 files okrun-native.sh --headless --seconds 170), before and afterBefore: that pair (
vertex 62148192acfb1bb1+pixel aa9cb047b21b22b1) was refused with the message above on every run (two headless runs, one refusal each).After: no
mismatching vertex shader outputrefusal in four headless runs — 289, 270 and 163 guessed pipelines on the main of the day, 110 on the current main after rebasing. The only conversion refusals left are the known compiler-crash (XPC_ERROR_CONNECTION_INTERRUPTED) ones.The rebuilt container of that vertex program now exports
HALF10/HALF11, the same name, type and four-channel width as the pixel program'sHALF10input.Unit test
emit::graphics::tests::a_half_kept_below_a_zeroed_word_still_countsfails without the change (PlainwhereHalvesis needed) and passes with it.Checklist
VICTORY_*variable and documented — none addedImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T03:56:52Z.
Review: APPROVED
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!