GPU/draw: reduce CPU work when preparing descriptor tables #1189
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1192"
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 fxceless/victory-fork. Originally posted by nicolasveilleux on 2026-11-25T23:24:43Z.
What changes
Descriptor contents, cache keys, fallback paths and GPU commands are unchanged. The expected benefit is less CPU work while recording draws and dispatches; no gameplay FPS gain has been measured.
Validation
On Windows 11 with an RTX 2070 Super, using public code and synthetic test data only, release build with diagnostics:
cargo test -p victory-gpu --lib --release --offline --locked --features diagnostics table_: 3 passed.cargo test -p victory-gpu --lib --release --offline --locked --features diagnostics descriptor::: 28 passed.git diff --check: clean.Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-25T23:52:43Z.
I tried this with #927. Its half-precision buffer views can lie past the range's first declared descriptor, so they still need to contribute to the table length after indexed expressions move into the stage layout. Otherwise the slot containing the half view can end up outside the fresh table.
I pushed the combined three commits on top of #927. The path with zero or one expression still avoids allocating when there are no extra half views. The slot-set, inline offset and layout tests passed, and the existing
a_fresh_table_holds_the_half_views_past_its_range_startsregression passed under Wine 11.22 with RADV 26.3.1 on the RX 7900 XT. This is useful if both PRs land.I also tried an integration build with both changes and our other renderer patches. With scripted input enabled the run ended in device loss 95.7 seconds into startup, before the first-room timing window. I excluded it from the performance results. That run does not isolate the cause. The synthetic compatibility test above passed.
Imported from fxceless/victory-fork. Originally posted by alpz1000 on 2026-11-26T05:09:03Z.
I built
cee1b7dinto a local Windows diagnostics build and ran it on an i5-8400, RTX 3060 12 GB (610.88), 32 GB RAM. Both builds used the same local base and settings, the same stationary Series S checkpoint, and separate copies of the same initial pipeline library. The candidate adds only this PR and the merge resolution that retained the base's diagnostic counters.I selected windows with 4,250–4,750 draws and under 1 ms of pipeline waiting. FPS and p90 include long frames. Recording time sums all recording threads, so the 18 ms reduction does not imply an 18 ms change in frame time. This was one run per build. It shows lower recording time, with no gameplay FPS gain in this sample.
In the integrated tree,
cargo test --profile diag --locked -p victory-gpu --features diagnostics --lib table_ -- --test-threads=1passed 3/3, and the correspondingdescriptor::filter passed 30/30. AI-assisted test and write-up.Imported from fxceless/victory-fork. Originally posted by KainanP on 2026-11-27T15:13:48Z.
Independent A/B of this PR on the RTX 4060 Laptop, against its own merge base
b8994e1(the PR is 112 commits behindmainand conflicts).Bench:
pipeline::list_bench::table_bench(KainanP/victory-forkbench/desc-tables,#[ignore]) ports the draw sequence of our VIctory list bench to the fork. Each draw binds a material table (one constant buffer view and five textures the title placed in memory), and each table sits at its own place in the title's heap. A list has 2,000 tables, and half of them repeat the contents of an earlier one, as in #1379. A list is closed (timed) and reset every 2,000 draws. Cells are ns per draw for the whole sequence (table, root CBV, 4 constants, index buffer, draw), each the median of 7 interleaved processes, each process the best of 5. RTX 4060 Laptop, i7-14650HX. A headless Chrome from other work used about 2 cores. This bench times recording only: lists are not submitted, so fills done at submission do not show here.b8994e1cee1b7dAn earlier run of 7 gave 17,303 / 23,496 for the base and 12,680 / 23,254 for the PR. The base cell in that run is noise: its single runs ranged from 10.5 to 38 µs.
So it is at most a few percent, within this machine's noise. The bookkeeping it trims is small next to what a table made afresh costs here (diagnostics build, a 6-slot table): about 10 µs to make the five texture views, about 6 µs to make the entries readable, and about 1 µs for the view lookups.
Correctness. Our
tables_show_their_viewspasses: every texture slot of the tables made for 64 draws, over three lists, holds the descriptor the host makes of its view, and its host texture.fresh_table_offsets_preserve_slots_and_failure_marker,fresh_table_slots_preserve_sorted_unique_orderandtable_layout_preserves_shader_order_and_first_record_aliaspass.For the texture-view part: #1484.
AI use: Claude Code (Claude Opus 5.5).
Imported from fxceless/victory-fork. Originally posted by akimfomin on 2026-11-28T02:03:23Z.
Pairing
cee1b7dewith #854 changes the samedraw.rscode and conflicted in the pinned trial. If both are kept, a compact check is to replay a pipeline with mixed buffer view widths and assert that a cold layout and a cached one pick exactly the same first alias. Vary the selected wave lowering without changing the descriptor record; readback bytes should remain the same.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.