metal: always set depth bias per draw so zero bias resets prior bias #25
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25"
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 claytonblythe on 2026-11-26T09:42:48Z.
Addresses sticky depth bias in Metal render passes (related to #18).
Summary
crates/victory-metal/src/gfx.rs,setDepthBias_slopeScale_clampwas gated onif r.depth_bias != (0.0, 0.0, 0.0), so a draw with zero depth bias in the same render pass inherited the previous draw's non-zero depth bias.setDepthBias_slopeScale_clampper draw (matchingsetCullMode,setFrontFacingWinding,setTriangleFillMode, andsetDepthClipMode).depth_bias_resets_between_draws_in_the_same_passincrates/victory-gpu/src/native/state_tests.rsthat fails without this fix.Testing
VICTORY_MSC_DYLIB=... cargo test --target x86_64-apple-darwin -p victory-gpu --lib native::tests::state_tests -- --test-threads=1(5/5 passed on Metal).cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings(0 warnings).cargo xtask policy(363 files ok).Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T10:08:07Z.
Review: APPROVED
Reviewed and tested merged with current main (
a2940ab): full test suite incl. victory-shader, the new depth_bias_resets_between_draws_in_the_same_pass test on Metal, clippy for the Windows target and xtask policy all pass. Thanks!