Skip to content

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

Open
adritoyalser wants to merge 1 commit into
fxceless:mainfrom
adritoyalser:fix/placed-filler-key
Open

adritoyalser wants to merge 1 commit into
fxceless:mainfrom
adritoyalser:fix/placed-filler-key

Conversation

@adritoyalser

Copy link
Copy Markdown

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 GPU: keep clippy green without the diagnostics feature #491)

…ans::bytes

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`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant