GPU: placed texture sizes leave out the filler words; the twin count is diagnostics-only and capped #409
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/409"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Esteban-V on 2026-11-27T00:06:46Z.
Commit
c96b4f2took words 1 and 13 of a placed texture's description (the layout's filler, where the title leaves stack garbage) out of thePLACED_TEXTURESkey, but three other places still keyed on the raw 14 words.PLACED_RAW(crates/victory-gpu/src/resource.rs~3046-3064) grows by one for each new (address, raw description) pair, is never trimmed, and is read only by theplaced_filler_twinslog line incopystat.rs:941, which is compiled only withfeature = "diagnostics". Theplaced_bytes_frommemo (resource.rs~1363-1368) was keyed on the raw description and skipped whenfirst == 0or!held_only(), so those calls went throughplaced_bytes->footprint->texture_layout->Texture::newevery time. This keys all three on the filler-free description.PLACED_RAW,PLACED_TWINS,placed_filler_twinsand the counting (moved intocount_twin) are now#[cfg(all(windows, feature = "diagnostics"))]. With diagnostics on, the set stops taking entries at 65,536 (twin_room).(without_filler(desc), first), withfirstforced to 0 when!held_only();first == 0uses it too and returnsplaced_bytes(desc), as before.Spans::sizes(descriptor/host.rs616, 648-655) is keyed onwithout_filler(desc), a new helper thattexture_atandcount_twinreuse.ResourceDesc(resource.rs:87), andplaced_bytes,footprint,texture_layoutandread_fromread only named fields.first_mip<= 15); the comment onPLACED_SIZESsays so.PLACED_TEXTURESkeys,texture_at_made,shape_of/Views::shapeandVICTORY_PLACED_FILLERare untouched.Testing
windows-latest): Clippy, default tests and diagnostics tests pass (run).x86_64-pc-windows-msvcon a macOS host (cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, default and--all-features).placed_sizes_leave_out_the_fillerandplaced_twins_stop_at_the_cap(diagnostics only) added next toa_placed_texture_is_kept_from_the_level_viewed; both compile under clippy--all-targets.Imported from Belobug/VIctory-Belobug-AMD. Originally posted by lvndrpup on 2026-11-27T05:00:23Z.
Review: COMMENTED
Checked at
056e123on an RTX 3060 Ti 8 GB, Windows 11 build 26300, Rust 1.98.1, debug:victory-gpucargo test --libcargo clippy --all-targets -- -D warningsplaced_sizes_leave_out_the_filleramong them)--all-featuresplaced_twins_stop_at_the_captoo)I also checked the claim that the size cannot change against
ResourceDesc(resource.rs:87,repr(C)). Afterdimensiontheu64alignmentleaves 4 bytes of padding (word 1). The fields end at byte 52 and the struct's 8-byte alignment pads it to 56 (word 13). Those are exactly the two wordswithout_fillerzeroes, and every other word is a named field.Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Esteban-V on 2026-11-27T14:34:19Z.
Thanks for checking the padding against
ResourceDescby hand, that's exactly the assumption the change depends on. And good to see both new tests passing on NVIDIA.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.