GPU: ignore placed-texture filler words in same_placed_texture and Spans::bytes #502

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

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


Summary

Follow-up to c96b4f2 (which stripped the uninitialized stack filler words [1] and [13] from placed texture resource descriptions in resource::texture_at):

  • Extracted crate::resource::placed_desc_key(desc: &[u32; 14]) -> [u32; 14] (still honoring VICTORY_PLACED_FILLER=1) and used it in resource::texture_at.
  • Updated descriptor::host::same_placed_texture to compare normalized keys via placed_desc_key, so rewriting a streamed placed-texture view with different stack filler words keeps the existing host slot (KEPT_VIEWS) instead of nulling it out until re-uploaded.
  • Updated descriptor::host::Spans::bytes to key its sizes cache by placed_desc_key, preventing redundant footprint recomputations and unbounded cache growth from random stack filler.
  • Extended descriptor::host::tests::views_of_one_placed_texture_are_told_by_address_and_description to cover both same_placed_texture and Spans::bytes deduplication with differing filler words [1] and [13].

Verification

  • cargo test -q -p victory-gpu --lib --locked views_of_one_placed_texture_are_told_by_address_and_description (pass)
  • cargo clippy -q -p victory-gpu --all-targets --all-features --locked -- -D warnings (0 warnings; note default-feature clippy on c96b4f2 currently fails on pre-existing placed_filler_twins dead_code, tracked in #491)
<!-- greyfinch-sync:fxceless/victory-fork:issue:6595275186 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/502). Originally posted by [adritoyalser](https://github.com/adritoyalser) on 2026-11-25T01:49:27Z. --- ### Summary Follow-up to `c96b4f2` (which stripped the uninitialized stack filler words `[1]` and `[13]` from placed texture resource descriptions in `resource::texture_at`): - Extracted `crate::resource::placed_desc_key(desc: &[u32; 14]) -> [u32; 14]` (still honoring `VICTORY_PLACED_FILLER=1`) and used it in `resource::texture_at`. - Updated `descriptor::host::same_placed_texture` to compare normalized keys via `placed_desc_key`, so rewriting a streamed placed-texture view with different stack filler words keeps the existing host slot (`KEPT_VIEWS`) instead of nulling it out until re-uploaded. - Updated `descriptor::host::Spans::bytes` to key its `sizes` cache by `placed_desc_key`, preventing redundant footprint recomputations and unbounded cache growth from random stack filler. - Extended `descriptor::host::tests::views_of_one_placed_texture_are_told_by_address_and_description` to cover both `same_placed_texture` and `Spans::bytes` deduplication with differing filler words `[1]` and `[13]`. ### Verification - `cargo test -q -p victory-gpu --lib --locked views_of_one_placed_texture_are_told_by_address_and_description` (pass) - `cargo clippy -q -p victory-gpu --all-targets --all-features --locked -- -D warnings` (0 warnings; note default-feature clippy on `c96b4f2` currently fails on pre-existing `placed_filler_twins` dead_code, 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/502:upstream-pr/502'
git switch 'upstream-pr/502'

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/502'
git switch 'upstream-pr/502'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/502'
git switch 'upstream-pr/502'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/502'
git switch 'main'
git merge --squash 'upstream-pr/502'
git switch 'main'
git merge --ff-only 'upstream-pr/502'
git switch 'main'
git merge 'upstream-pr/502'
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!502
No description provided.