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

Open
adritoyalser wants to merge 1 commit from upstream-pr/506 into main
adritoyalser commented 2026-11-25 01:51:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by adritoyalser on 2026-11-25T01:51:38Z.


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)
<!-- greyfinch-sync:fxceless/victory-fork:issue:6595301810 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/506). Originally posted by [adritoyalser](https://github.com/adritoyalser) on 2026-11-25T01:51:38Z. --- ### 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)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/506:upstream-pr/506'
git switch 'upstream-pr/506'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/506'
git switch 'upstream-pr/506'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/506'
git switch 'upstream-pr/506'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/506'
git switch 'main'
git merge --squash 'upstream-pr/506'
git switch 'main'
git merge --ff-only 'upstream-pr/506'
git switch 'main'
git merge 'upstream-pr/506'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!506
No description provided.