metal: always set depth bias per draw so zero bias resets prior bias #25
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!25
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/25/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?
@claytonblythe on GitHub · 2026-11-26 09:42 UTC · original
claytonblythe:fix/metal-sticky-depth-bias→main· +28 −3 · 2 files · 2 commits · merged 2026-11-26 10:12 UTCAddresses 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).@LakshanSivakumar on GitHub · 2026-11-26 10:08 UTC · original · approved these changes
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!