metal: fix present pass black screen by binding sampler at draw time #89
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!89
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-89"
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?
@ShivamCodesBS on GitHub · 2026-11-26 14:01 UTC · original
ShivamCodesBS:fix/black-screen-present-pass→main· +16 −2 · 1 files · 1 commits · closed without mergingThe present pass shader uses a sampler (), but the sampler was never bound at draw time. The constexpr sampler in the original MSL was not being recognized by Metal because it wasn't bound via the encoder.
Fix: Change the shader to use a regular sampler argument () and bind a matching MTLSamplerState at draw time in try_present().
This fixes the black screen issue where the present pass couldn't sample the source texture because no sampler was bound.
What this changes
How it was tested
cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victorycargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningsChecklist
VICTORY_*variable and documented@LakshanSivakumar on GitHub · 2026-11-26 14:55 UTC · original
Thanks for digging into the black window. #91 fixes the root cause (the converter's static-sampler table was never written), confirmed on M2 Max in #99; the present pass's constexpr sampler is valid MSL, so this change isn't needed. Closing in favour of #91.
Pull request closed