GPU: check for a bound view heap before claiming the frame in early_textures #506

Open
github-bot wants to merge 1 commit from github-bot/gh-506 into main AGit
Owner

@⁠adritoyalser on GitHub · 2026-11-25 01:51 UTC · original
adritoyalser:fix/early-textures-heap-check → main · +134 −18 · 1 files · 1 commits · open

Summary

Follow-up to c96b4f2:

  • In crates/victory-gpu/src/draw.rs (State::early_textures), FRAME.swap(frame, Ordering::Relaxed) previously executed before verifying that self.heaps contains a view heap (!h.samplers()) with a HostHeap. If the first draw of a frame had no view heap bound (or no host heap yet), it burned the frame's first flag and returned early, skipping the frame's VICTORY_EARLY_TEXTURES_MS upload pass for all subsequent draws in that frame.
  • Moved the view-heap / host-heap lookup ahead of claiming the frame budget (via early_textures_with / claim_early_budget) so FRAME is only claimed on the frame's first draw that actually has a view heap set, matching the doc comment.
  • Added two unit tests in draw::early_textures_tests:
    • early_budget_runs_once_per_frame_and_resets_bake_budget
    • early_textures_without_view_heap_does_not_burn_frame_pass (verifying a draw without a view heap leaves the frame unclaimed so a subsequent draw with a real view heap on the same frame still runs the early texture pass).

Verification

  • cargo test -q -p victory-gpu --lib --locked early_textures_tests (2 passed, 0 failed)
  • cargo clippy -q -p victory-gpu --all-targets --all-features --locked -- -D warnings (0 warnings; default-feature clippy on c96b4f2 currently fails on pre-existing placed_filler_twins, tracked in #491)
**@⁠adritoyalser** on GitHub · 2026-11-25 01:51 UTC · [original](https://github.com/fxceless/victory-fork/pull/506) `adritoyalser:fix/early-textures-heap-check` → `main` · +134 −18 · 1 files · 1 commits · open ### Summary Follow-up to `c96b4f2`: - In `crates/victory-gpu/src/draw.rs` (`State::early_textures`), `FRAME.swap(frame, Ordering::Relaxed)` previously executed before verifying that `self.heaps` contains a view heap (`!h.samplers()`) with a `HostHeap`. If the first draw of a frame had no view heap bound (or no host heap yet), it burned the frame's `first` flag and returned early, skipping the frame's `VICTORY_EARLY_TEXTURES_MS` upload pass for all subsequent draws in that frame. - Moved the view-heap / host-heap lookup ahead of claiming the frame budget (via `early_textures_with` / `claim_early_budget`) so `FRAME` is only claimed on the frame's first draw that actually has a view heap set, matching the doc comment. - Added two unit tests in `draw::early_textures_tests`: - `early_budget_runs_once_per_frame_and_resets_bake_budget` - `early_textures_without_view_heap_does_not_burn_frame_pass` (verifying a draw without a view heap leaves the frame unclaimed so a subsequent draw with a real view heap on the same frame still runs the early texture pass). ### Verification - `cargo test -q -p victory-gpu --lib --locked early_textures_tests` (2 passed, 0 failed) - `cargo clippy -q -p victory-gpu --all-targets --all-features --locked -- -D warnings` (0 warnings; default-feature clippy on `c96b4f2` currently fails on pre-existing `placed_filler_twins`, tracked in #491)
In `State::early_textures` (added in c96b4f2), `FRAME.swap(frame)` ran
before checking whether a view heap with a host heap was bound on the
list. Any frame whose first draw had no view heap set consumed `first`
and returned immediately, skipping that frame's `VICTORY_EARLY_TEXTURES_MS`
upload pass even when later draws in the same frame did bind a view heap.

Look up the bound view heap and its host heap first, then claim the
frame's early/bake budget.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:44:55 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/506/head:github-bot/gh-506'
git switch 'github-bot/gh-506'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-506'
git switch 'github-bot/gh-506'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-506'
git switch 'github-bot/gh-506'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-506'
git switch 'main'
git merge --squash 'github-bot/gh-506'
git switch 'main'
git merge --ff-only 'github-bot/gh-506'
git switch 'main'
git merge 'github-bot/gh-506'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.