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

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

@⁠adritoyalser on GitHub · 2026-11-25 01:49 UTC · original
adritoyalser:fix/placed-filler-key → main · +33 −18 · 2 files · 1 commits · open

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)
**@⁠adritoyalser** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/502) `adritoyalser:fix/placed-filler-key` → `main` · +33 −18 · 2 files · 1 commits · open ### 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)
Commit c96b4f2 normalized the uninitialized stack filler words (1 and 13)
of placed texture resource descriptions in `resource::texture_at`, so two
views differing only there share one host texture.

`descriptor::host::same_placed_texture` and `Spans::bytes` still compared
and cached the raw 14-word description, causing `HostHeap::mirror` to null
out an existing slot (flashing black while queued) whenever a streamed mip
update carried different stack filler, and causing `Spans::sizes` to miss
and grow per unique filler value.

Share `resource::placed_desc_key` across `texture_at`, `same_placed_texture`,
and `Spans::bytes` (preserving `VICTORY_PLACED_FILLER=1`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:44:50 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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