Views: placed views' shapes leave out description padding, so the view table stops leaking #247
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/247"
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 DexNom/VIctory. Originally posted by SpeezusChrist23 on 2026-12-01T00:56:40Z.
Symptom
In a long play session, the CPU time spent preparing each frame grows steadily while GPU time stays flat:
Short test runs (30 min) do not show it.
Cause
descriptor.rsViewsnames a view of placed memory in its record by a shape (the resource and view descriptions without the address, at most 2^22 = 4,194,304) and the address. The shapes are meant to be as many as the title has kinds of textures and buffers. But a shape kept words 1 and 13 of the resource description, which are the padding ofD3D12_RESOURCE_DESC's layout. The title leaves there whatever its stack held.resource::texture_atalready leaves those two words out of its key for that reason. Its "asked for again with other filler words" count reached 563k in the same run.So almost every placed view written made a new shape:
Evidence
One ~100-min session at 1080p, in 5-min buckets of the memory and frame log lines:
With the fix (a live session with the same settings): 71,928 shapes at 16 min (1.8 M at 10 min before), and the view table at 8,741 entries / 30 MB (10 GB before).
The fix (
without_filler, on by default)create_placed_srv/create_placed_uavzero the padding before the view is recorded:The host reads these descriptions only as the D3D12 structures (
srv_desc/uav_desc) and by their meaningful words, so nothing it builds changes. Views that differed only in padding become one shape and one record, so their slots are also no longer re-made for padding alone.Switch and logging
VICTORY_SHAPE_FILLER=1keeps the padding, as before.=2leaves out only resource words 1/13.Tests
descriptor::tests::filler_makes_no_new_shapes: 5,000 placed views with the run's kind of padding (words 1 and 13 changing, the view's word 3 and unused union words changing) make one shape, and the view read back has no padding. Another mip count or height still makes a new shape.descriptor::tests::filler_leaves_what_the_host_reads: every member word of buffer SRV/UAV, 2-D UAV and 2-D array SRV views is kept, and unknown dimensions are kept whole.descriptor::tests::views_at_new_addresses_add_no_entriesis updated for views read back without padding.Checked on this branch:
cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, the same with--all-features, andcargo test -p victory-gpu --lib(221 passed, 4 ignored; all 45descriptor::tests pass).Found and verified on an AMD RX 6700 XT.
🤖 Generated with Claude Code
https://claude.ai/code/session_01S4xxcyVsTQvsBVmaF2gBZs
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.