WIP: perf(vk): a draw of the program before it keeps its texture and storage descriptors while their bindings stand (RX_VK_DESC_SECTIONS, off) #2210

Draft
siantm wants to merge 3 commits from siantm/Longshot:perf/vk-desc-sections into main
Contributor

Summary

A draw keeps the descriptors of the draw before it only while nothing at all was bound since (same_desc in draw(), gpu/vk/vk_draw.cpp), and the game binds a uniform buffer for nearly every draw: most draws resolved every texture's handle, view and sampler and every storage buffer's pool again, though only a uniform buffer's range had changed. build_descriptors now treats a program's descriptors as three sections by what they are read from: the uniform buffers (built at every build, as before), the texture section (textures with their samplers and read-only storage images, whose handles are words of c2 of their own stage) and the storage section (read-only storage buffers that are one entry of their stage's c0 table). A draw of the program whose build its command buffer bound last, with no other build since, keeps a section's infos from that build while everything it was resolved from stands:

  • the texture section while its stages' tex_gen, the texture destroy generation, the samplers' registrations, the texture epoch, the slots' versions (or the registrations' generation, as same_desc checks them) and each texture's GPU-written state stand (desc_tex_kept);
  • the storage section while its stages' ssbo_gen and gpu_bind_stamp stand and none of its buffers came out unbound or lies in a virtual pool (desc_ssbo_kept);
  • which programs can keep a section is the program's own, worked out once (desc_sections_of): a handle program, another bank, a table, a texel buffer, anything the program writes, a simulated-turf private buffer, or a compute, task or mesh stage leave a section out;
  • never for the mesh fallback, in a frame dump, with RX_VK_DESC_REUSE=never, or while a diagnostic that looks at every binding is set;
  • what a build does besides resolving is kept with the section: the handles noted for Descriptor reuse, the hazards' list of sampled textures, the dummy count.

RX_VK_DESC_REFRESH: when every descriptor but the uniform buffers is kept (or there is none of the rest), the writer stays as it is and only the uniform buffers are resolved again, in the build's order (refresh_uniform_descriptors); otherwise the kept infos are copied back and every write is made again. The descriptors written are meant to be the same either way; the result expected is less replay time for draws that change only their uniform buffers. The frame log gets a line every 120 presents counting the draws that kept a section.

Switches (rows in gpu/vk/switches.def): RX_VK_DESC_SECTIONS is an attempt and ships off: unset or 0 is main's build, 1 (any value but 0, false, off, no) turns the sections on. The default follows dazemc's review: it stays off until the in-game comparison exists (Still to test). RX_VK_DESC_REFRESH (kind kill, on) acts only under it: with RX_VK_DESC_SECTIONS unset or 0 no build keeps a section, so the refresh does nothing and is never read; with RX_VK_DESC_SECTIONS=1, RX_VK_DESC_REFRESH=0 keeps the sections but copies them back and makes every write again. Each is read once, at its first use (so HOS_AB cannot alternate them); a set value is logged once, and an unset RX_VK_DESC_SECTIONS logs nothing.

With the sections off, build_descriptors and draw() do none of their work: no count of builds (a shared atomic), no build number, no lookup of the kept infos or of the texture record, no note per storage buffer write, dummy texture or unbound storage buffer. What is left of the change on that path is the switch's test (a function-local static, read once) in the build and in draw(), a call reading it at each bind, and branches on it; not timed.

Prior work: dyst's #794 (closed) kept a stage's descriptors across draws in a recording part while what they were resolved from stood. This takes the same idea up again in the branch's narrower form: only the last build of the program the command buffer bound, as the writer holds it, and never the uniform buffers (#794 kept every program's stages in a table of their own, uniform buffers too). #794 measured a loss: its own A/B had the descriptor time slower than main (3.4 to 3.9 ms a frame against 2.5 to 2.9 ms), and dyst closed it. From its code, each build checked and re-applied kept keys for textures, storage buffers and uniform buffers, and the uniform buffers move with nearly every draw; this keeps only the bound program's last build and never the uniform buffers, which should check less a build, but this pull request's own descriptor time is not measured yet. Open pull requests in the same function: #1232 (jcabarca) changes which sampler a texture binding asks sampler_for for, in the loop this change skips for a kept section; a kept section holds the samplers its build chose, so the two compose (the same textures give the same views), and the second to merge may need a rebase. #2045, #2055, #2057 and #2058 (mine) touch build_descriptors too: neighbouring lines only.

Since the branch, main lost the parallel replay (its check is gone here) and gained gp_table_cover, which looks at a virtual pool's pages at every binding (a storage section with a buffer in a virtual pool is bound again at the next build, and RX_VK_GP_TABLE turns the sections off), and the simulated turf's private storage buffers (#2093), which sim_turf_private_binding sizes and binds by their demand at every build (a storage section with one is never kept).

From d1e33769 (as at 6a4a8ec0) and 498b07fa on exp/x86-asm-sync.

Read first: the comment above kSectTex, then desc_sections_on, desc_tex_kept, desc_ssbo_kept and refresh_uniform_descriptors, the head of build_descriptors and the sections' condition in draw() (gpu/vk/vk_draw.cpp).

Testing

Tested: Windows 11, i7-9700, RTX 4060, the builder's llvm-mingw clang 23; head f1249421 on main @ a2dc5385. Every check ran through the PC's job queue in build jobs, in a hidden console, with the Vulkan headers found (jobs dsc2210, dsc2210-m2):

  • Its own: tests/test_desc_sections.py: pass. It cuts from the source, compiles and runs the rules for which descriptors a section can keep, the checks against what a section was made from (each part of a section's record moved alone fails its check; a texture that went, on a page made inaccessible after the destroy generation moved, fails the check without being read; an eviction whose memory is made into another texture at once fails it on the generation alone) and the refresh; runs both switches' readers in fresh processes (unset, 0, off, false, no, 1, on and another value, twice each, set the other way after the first read: RX_VK_DESC_SECTIONS unset is off and logs nothing, RX_VK_DESC_REFRESH unset is on; RX_VK_DESC_SECTIONS=1 is off with each per-binding diagnostic set); and reads vk_texture.cpp (a texture leaves the texture table only after destroy_later moved the generation), draw() and build_descriptors (where a section is kept, that a kept one looks nothing up, and that with the switch off no statement naming the sections' own state runs). The first new commit alone (6a8299fa: the two texture cases on the earlier code) passes too. tests/test_desc_counts.py and tests/test_hidden_mesh_depth.py (they read the build's signature): pass.
  • Mutants, each on a copy of the files the check reads (a tool of mine, not in this PR), each failing the check as it should: the destroy generation's check removed (the texture-that-went case and the eviction case, each run alone); the gpu_written loop moved to the top of desc_tex_kept (the texture-that-went case: it reads the page and stops with its FAIL line); the destroy_later before one erase from the texture table removed; the default turned on; and each of the eight off-path statements put back outside the switch.
  • The 198 checks that read a file this change touches (--changed a2dc5385; its own are among them): 181 passed, 11 failed, 6 skipped (Linux only). Failed: tests/test_crash_dialog.py, tests/test_dev_ab.py, tests/test_dev_packs.py, tests/test_draw_stream_visibility.py, tests/test_fsr_uniform_ownership.py, tests/test_input_movie.py, tests/test_recording_admission.py, tests/test_sampler_admission.py, tests/test_sim_turf_pools.py, tests/test_switch_table.py, tests/test_tls_objects.py: each fails on main @ a2dc5385 too (the same 11 in the earlier batch's run of main, t-DescCut3-base); tests/test_switch_table.py here only for main's own unsorted RX_VK_GRASS_DISTANCE row.
  • gpu/vk/vk_draw.cpp compiled with the game build's own command (syntax only): pass.

It has NOT run in the game on this PC yet.

Still to test:

  • Windows 11, i7-9700, RTX 4060 (this PC), the in-game comparison that decides the default: Kokiri Forest from the scene's save (the light load state, as the scene's runner pins it), 60 s at 800x600 CPU-paced, RX_VK_DESC_SECTIONS unset (main's build) against RX_VK_DESC_SECTIONS=1 in this PR's build, a warm-up a side then 8 a side interleaved, RX_VK_PROF_FINE=1 on every run (the descriptor time and draw time a frame), and RX_VK_ASYNC_PARTS and RX_VK_ASYNC_FENCES (#2211, #2212) set the same on both sides; the counter is the frame log's vk: a frame: ... draws kept their texture section, ... their storage section (of ... that built descriptors) line on the =1 side (the unset side has none); then the Castle Town Market a run a side. Expected: the same picture both ways, and with =1 the descriptor time a frame the same as or lower than with =0 (by hand)
  • Linux NVIDIA and AMD, Windows AMD and Intel, Steam Deck: start in Kokiri Forest from the scene's save, play a minute (walking, turning the camera), main against this PR with RX_VK_DESC_SECTIONS=1, warmed, in ABBA order, expecting the same picture both ways and no crash or validation error (Test Farm: linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: Kokiri Forest a minute, main against this PR with RX_VK_DESC_SECTIONS=1, ABBA, the same picture)
  • Linux (any GPU): build the renderer and run tests/test_desc_sections.py with --cxx g++ and --cxx clang++, expecting PASS (by hand)

Measurements

Verdict: not measured: no micro-benchmark of this port and no run in the game on this PC yet, so it is not shown that this avoids the loss #794 measured (its descriptor time slower than main); the in-game A/B (descriptor and draw time a frame, RX_VK_DESC_SECTIONS=0 against =1) is in Still to test. So RX_VK_DESC_SECTIONS ships off (an attempt), as dazemc's review asks, until that comparison exists; RX_VK_DESC_REFRESH acts only under it. Off, the build does none of the sections' work (Summary); what is left on that path, the switch's test and branches on it, is not timed. The other names the diff adds are existing diagnostics, each already in gpu/vk/switches.def with its own default (off, unset), which this change does not change: RX_VK_DRAW_STATS, RX_VK_DRAW_STATS_PROGS, RX_VK_SLOW_DESC, RX_VK_WATCH_PROG, RX_VK_PEEK_PROG, RX_VK_TRACE_TEX, RX_VK_LOG_IMG, RX_VK_LOG_HITS, RX_VK_SSBO_STRETCH, RX_VK_SSBO_WIDE, RX_VK_ASYNC_IMPORT and RX_VK_GP_TABLE: set (any value), each turns the sections off, since a kept section would hide the bindings it looks at or changes.

Risks

A kept section that building it again would not give is a wrong texture, a stale storage buffer, or a view or sampler already freed (a crash or a lost device). Every part of what a section was made from is checked before it is kept (the test moves each alone), and anything not known to stand builds the section again. The samplers are kept on the same terms as main's own whole-set reuse (same_desc): while the samplers' registration generation stands. A texture's pointer in a kept section's record is read only after the destroy generation's check, and a texture leaves the texture table only after destroy_later moved that generation (the test checks both, with a texture that went and one made again in its memory). The new frame-log line is printed every 120 presents while the sections are on. On only with RX_VK_DESC_SECTIONS=1; unset or 0 is main's build; RX_VK_DESC_REFRESH=0 turns off only the in-place refresh. The renderer is compiled again after updating; Program (gpu/vk/vk_shader.h) gains a field and no file in nx2/translator_files.py changes, so players' programs are not translated again.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. Not yet: it has not run in the game.
  • mise run test passes (any failure that also fails on main is named). Not yet: only the checks in Testing ran.
  • Measured against main, or Measurements says why there is nothing to measure. Not yet (Measurements).
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def. Its rows are in; RX_VK_DESC_SECTIONS ships off (an attempt) until it is measured.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Not yet: only the checks' cuts compiled (Testing).
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
## Summary A draw keeps the descriptors of the draw before it only while nothing at all was bound since (`same_desc` in `draw()`, `gpu/vk/vk_draw.cpp`), and the game binds a uniform buffer for nearly every draw: most draws resolved every texture's handle, view and sampler and every storage buffer's pool again, though only a uniform buffer's range had changed. `build_descriptors` now treats a program's descriptors as three sections by what they are read from: the uniform buffers (built at every build, as before), the texture section (textures with their samplers and read-only storage images, whose handles are words of c2 of their own stage) and the storage section (read-only storage buffers that are one entry of their stage's c0 table). A draw of the program whose build its command buffer bound last, with no other build since, keeps a section's infos from that build while everything it was resolved from stands: - the texture section while its stages' `tex_gen`, the texture destroy generation, the samplers' registrations, the texture epoch, the slots' versions (or the registrations' generation, as `same_desc` checks them) and each texture's GPU-written state stand (`desc_tex_kept`); - the storage section while its stages' `ssbo_gen` and `gpu_bind_stamp` stand and none of its buffers came out unbound or lies in a virtual pool (`desc_ssbo_kept`); - which programs can keep a section is the program's own, worked out once (`desc_sections_of`): a handle program, another bank, a table, a texel buffer, anything the program writes, a simulated-turf private buffer, or a compute, task or mesh stage leave a section out; - never for the mesh fallback, in a frame dump, with `RX_VK_DESC_REUSE=never`, or while a diagnostic that looks at every binding is set; - what a build does besides resolving is kept with the section: the handles noted for Descriptor reuse, the hazards' list of sampled textures, the dummy count. `RX_VK_DESC_REFRESH`: when every descriptor but the uniform buffers is kept (or there is none of the rest), the writer stays as it is and only the uniform buffers are resolved again, in the build's order (`refresh_uniform_descriptors`); otherwise the kept infos are copied back and every write is made again. The descriptors written are meant to be the same either way; the result expected is less replay time for draws that change only their uniform buffers. The frame log gets a line every 120 presents counting the draws that kept a section. Switches (rows in `gpu/vk/switches.def`): `RX_VK_DESC_SECTIONS` is an attempt and ships **off**: unset or `0` is main's build, `1` (any value but `0`, `false`, `off`, `no`) turns the sections on. The default follows dazemc's review: it stays off until the in-game comparison exists (Still to test). `RX_VK_DESC_REFRESH` (kind kill, on) acts only under it: with `RX_VK_DESC_SECTIONS` unset or `0` no build keeps a section, so the refresh does nothing and is never read; with `RX_VK_DESC_SECTIONS=1`, `RX_VK_DESC_REFRESH=0` keeps the sections but copies them back and makes every write again. Each is read once, at its first use (so `HOS_AB` cannot alternate them); a set value is logged once, and an unset `RX_VK_DESC_SECTIONS` logs nothing. With the sections off, `build_descriptors` and `draw()` do none of their work: no count of builds (a shared atomic), no build number, no lookup of the kept infos or of the texture record, no note per storage buffer write, dummy texture or unbound storage buffer. What is left of the change on that path is the switch's test (a function-local static, read once) in the build and in `draw()`, a call reading it at each bind, and branches on it; not timed. Prior work: dyst's #794 (closed) kept a stage's descriptors across draws in a recording part while what they were resolved from stood. This takes the same idea up again in the branch's narrower form: only the last build of the program the command buffer bound, as the writer holds it, and never the uniform buffers (#794 kept every program's stages in a table of their own, uniform buffers too). #794 measured a loss: its own A/B had the descriptor time slower than main (3.4 to 3.9 ms a frame against 2.5 to 2.9 ms), and dyst closed it. From its code, each build checked and re-applied kept keys for textures, storage buffers and uniform buffers, and the uniform buffers move with nearly every draw; this keeps only the bound program's last build and never the uniform buffers, which should check less a build, but this pull request's own descriptor time is not measured yet. Open pull requests in the same function: #1232 (jcabarca) changes which sampler a texture binding asks `sampler_for` for, in the loop this change skips for a kept section; a kept section holds the samplers its build chose, so the two compose (the same textures give the same views), and the second to merge may need a rebase. #2045, #2055, #2057 and #2058 (mine) touch `build_descriptors` too: neighbouring lines only. Since the branch, main lost the parallel replay (its check is gone here) and gained `gp_table_cover`, which looks at a virtual pool's pages at every binding (a storage section with a buffer in a virtual pool is bound again at the next build, and `RX_VK_GP_TABLE` turns the sections off), and the simulated turf's private storage buffers (#2093), which `sim_turf_private_binding` sizes and binds by their demand at every build (a storage section with one is never kept). From d1e33769 (as at 6a4a8ec0) and 498b07fa on `exp/x86-asm-sync`. Read first: the comment above `kSectTex`, then `desc_sections_on`, `desc_tex_kept`, `desc_ssbo_kept` and `refresh_uniform_descriptors`, the head of `build_descriptors` and the sections' condition in `draw()` (`gpu/vk/vk_draw.cpp`). ## Testing **Tested:** Windows 11, i7-9700, RTX 4060, the builder's llvm-mingw clang 23; head f1249421 on main @ a2dc5385. Every check ran through the PC's job queue in build jobs, in a hidden console, with the Vulkan headers found (jobs `dsc2210`, `dsc2210-m2`): - Its own: `tests/test_desc_sections.py`: pass. It cuts from the source, compiles and runs the rules for which descriptors a section can keep, the checks against what a section was made from (each part of a section's record moved alone fails its check; a texture that went, on a page made inaccessible after the destroy generation moved, fails the check without being read; an eviction whose memory is made into another texture at once fails it on the generation alone) and the refresh; runs both switches' readers in fresh processes (unset, `0`, `off`, `false`, `no`, `1`, `on` and another value, twice each, set the other way after the first read: `RX_VK_DESC_SECTIONS` unset is off and logs nothing, `RX_VK_DESC_REFRESH` unset is on; `RX_VK_DESC_SECTIONS=1` is off with each per-binding diagnostic set); and reads `vk_texture.cpp` (a texture leaves the texture table only after `destroy_later` moved the generation), `draw()` and `build_descriptors` (where a section is kept, that a kept one looks nothing up, and that with the switch off no statement naming the sections' own state runs). The first new commit alone (6a8299fa: the two texture cases on the earlier code) passes too. `tests/test_desc_counts.py` and `tests/test_hidden_mesh_depth.py` (they read the build's signature): pass. - Mutants, each on a copy of the files the check reads (a tool of mine, not in this PR), each failing the check as it should: the destroy generation's check removed (the texture-that-went case and the eviction case, each run alone); the `gpu_written` loop moved to the top of `desc_tex_kept` (the texture-that-went case: it reads the page and stops with its FAIL line); the `destroy_later` before one erase from the texture table removed; the default turned on; and each of the eight off-path statements put back outside the switch. - The 198 checks that read a file this change touches (`--changed a2dc5385`; its own are among them): 181 passed, 11 failed, 6 skipped (Linux only). Failed: `tests/test_crash_dialog.py`, `tests/test_dev_ab.py`, `tests/test_dev_packs.py`, `tests/test_draw_stream_visibility.py`, `tests/test_fsr_uniform_ownership.py`, `tests/test_input_movie.py`, `tests/test_recording_admission.py`, `tests/test_sampler_admission.py`, `tests/test_sim_turf_pools.py`, `tests/test_switch_table.py`, `tests/test_tls_objects.py`: each fails on main @ a2dc5385 too (the same 11 in the earlier batch's run of main, `t-DescCut3-base`); `tests/test_switch_table.py` here only for main's own unsorted `RX_VK_GRASS_DISTANCE` row. - `gpu/vk/vk_draw.cpp` compiled with the game build's own command (syntax only): pass. It has NOT run in the game on this PC yet. **Still to test:** - Windows 11, i7-9700, RTX 4060 (this PC), the in-game comparison that decides the default: Kokiri Forest from the scene's save (the light load state, as the scene's runner pins it), 60 s at 800x600 CPU-paced, `RX_VK_DESC_SECTIONS` unset (main's build) against `RX_VK_DESC_SECTIONS=1` in this PR's build, a warm-up a side then 8 a side interleaved, `RX_VK_PROF_FINE=1` on every run (the descriptor time and draw time a frame), and `RX_VK_ASYNC_PARTS` and `RX_VK_ASYNC_FENCES` (#2211, #2212) set the same on both sides; the counter is the frame log's `vk: a frame: ... draws kept their texture section, ... their storage section (of ... that built descriptors)` line on the `=1` side (the unset side has none); then the Castle Town Market a run a side. Expected: the same picture both ways, and with `=1` the descriptor time a frame the same as or lower than with `=0` (by hand) - Linux NVIDIA and AMD, Windows AMD and Intel, Steam Deck: start in Kokiri Forest from the scene's save, play a minute (walking, turning the camera), main against this PR with `RX_VK_DESC_SECTIONS=1`, warmed, in ABBA order, expecting the same picture both ways and no crash or validation error (Test Farm: linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: Kokiri Forest a minute, main against this PR with RX_VK_DESC_SECTIONS=1, ABBA, the same picture) - Linux (any GPU): build the renderer and run `tests/test_desc_sections.py` with `--cxx g++` and `--cxx clang++`, expecting PASS (by hand) ## Measurements **Verdict:** not measured: no micro-benchmark of this port and no run in the game on this PC yet, so it is not shown that this avoids the loss #794 measured (its descriptor time slower than main); the in-game A/B (descriptor and draw time a frame, `RX_VK_DESC_SECTIONS=0` against `=1`) is in Still to test. So `RX_VK_DESC_SECTIONS` ships off (an attempt), as dazemc's review asks, until that comparison exists; `RX_VK_DESC_REFRESH` acts only under it. Off, the build does none of the sections' work (Summary); what is left on that path, the switch's test and branches on it, is not timed. The other names the diff adds are existing diagnostics, each already in `gpu/vk/switches.def` with its own default (off, unset), which this change does not change: `RX_VK_DRAW_STATS`, `RX_VK_DRAW_STATS_PROGS`, `RX_VK_SLOW_DESC`, `RX_VK_WATCH_PROG`, `RX_VK_PEEK_PROG`, `RX_VK_TRACE_TEX`, `RX_VK_LOG_IMG`, `RX_VK_LOG_HITS`, `RX_VK_SSBO_STRETCH`, `RX_VK_SSBO_WIDE`, `RX_VK_ASYNC_IMPORT` and `RX_VK_GP_TABLE`: set (any value), each turns the sections off, since a kept section would hide the bindings it looks at or changes. ## Risks A kept section that building it again would not give is a wrong texture, a stale storage buffer, or a view or sampler already freed (a crash or a lost device). Every part of what a section was made from is checked before it is kept (the test moves each alone), and anything not known to stand builds the section again. The samplers are kept on the same terms as main's own whole-set reuse (`same_desc`): while the samplers' registration generation stands. A texture's pointer in a kept section's record is read only after the destroy generation's check, and a texture leaves the texture table only after `destroy_later` moved that generation (the test checks both, with a texture that went and one made again in its memory). The new frame-log line is printed every 120 presents while the sections are on. On only with `RX_VK_DESC_SECTIONS=1`; unset or `0` is main's build; `RX_VK_DESC_REFRESH=0` turns off only the in-place refresh. The renderer is compiled again after updating; `Program` (`gpu/vk/vk_shader.h`) gains a field and no file in `nx2/translator_files.py` changes, so players' programs are not translated again. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. Not yet: it has not run in the game. - [ ] `mise run test` passes (any failure that also fails on `main` is named). Not yet: only the checks in Testing ran. - [ ] Measured against `main`, or Measurements says why there is nothing to measure. Not yet (Measurements). - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. Its rows are in; `RX_VK_DESC_SECTIONS` ships off (an attempt) until it is measured. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Not yet: only the checks' cuts compiled (Testing). - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.
perf(vk): a draw of the program before it keeps its texture and storage descriptors while their bindings stand (RX_VK_DESC_SECTIONS, on)
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
65da04cc3d
A draw keeps the descriptors of the draw before it only while nothing at all was bound since (same_desc in draw()), and
the game binds a uniform buffer for nearly every draw: most draws resolved every texture's handle, view and sampler and
every storage buffer's pool again, though only a uniform buffer's range had changed.

build_descriptors (gpu/vk/vk_draw.cpp) now sees a program's descriptors as three sections by what they are read from:
the uniform buffers (built at every build, as before), the texture section (textures with their samplers, read-only
storage images: handles in c2 of their own stage) and the storage section (read-only storage buffers that are one entry
of c0's table). A draw of the program whose build its command buffer bound last, with no other build since, keeps a
section's infos from that build while all it was made from stands:
- which programs can keep a section is the program's own (desc_sections_of, kept with the program once it is ready):
  a handle program, another bank, a table, a texel buffer, anything written, a simulated-turf private buffer (bound by
  its demand at every build), or a compute, task or mesh stage leave the section out;
- the texture section while its stages' tex_gen, the destroy generation, the samplers' registrations, the texture epoch,
  the slots' versions (or the registrations' generation, as same_desc checks them) and each texture's gpu_written stand
  (desc_tex_kept); the storage section while its stages' ssbo_gen and gpu_bind_stamp stand and none came out unbound or
  was in a virtual pool, whose pages gp_table_cover looks at at every binding (desc_ssbo_kept);
- never for the mesh fallback, in a frame dump, with RX_VK_DESC_REUSE=never or with a diagnostic that looks at every
  binding (RX_VK_DRAW_STATS, RX_VK_WATCH_PROG, RX_VK_GP_TABLE and the others the switch's row names);
- what a build does besides resolving is kept with the section: the handles noted for Descriptor reuse, the hazards'
  list of sampled textures, the dummy count.
RX_VK_DESC_REFRESH (the branch's 498b07fa): a build that keeps every section but its uniform buffers (or has none of the
rest) leaves the writer as it is and resolves the uniform buffers alone, in the build's order
(refresh_uniform_descriptors); otherwise the kept infos are copied back and every write made again.

The frame log gets a line every 120 presents: draws that kept their texture section, their storage section, of those
that built descriptors (relaxed atomics, each recording thread counting into them).

Switches: RX_VK_DESC_SECTIONS and RX_VK_DESC_REFRESH, kill, on by default (the branch's defaults); =0 (or false, off,
no) gives main's build. Each read once (env_on_or), at its first use. Rows in gpu/vk/switches.def.
Not measured on main.

Tests: tests/test_desc_sections.py (new) compiles desc_handle_in_c2, desc_ssbo_in_c0, desc_sections_of, desc_tex_kept,
desc_ssbo_kept, DescWriter and refresh_uniform_descriptors cut from the source and runs them (each part of a section's
record moved alone fails its check; the refresh resolves only the uniform buffers, in order, every write and info left
in place), runs both switches' readers in fresh processes (unset, 0, off, false, no, 1, on and another value, twice
each, set the other way after the first read; the sections off with each diagnostic set), and reads draw() and
build_descriptors for where a section is kept and that a kept one looks nothing up. test_desc_counts.py and
test_hidden_mesh_depth.py read the build's new signature.

From 6a4a8ec0 (d1e33769's sectional rebuild) and 498b07fa on exp/x86-asm-sync.

Assisted-by: Claude Code
Author
Contributor

@Beanstalk This keeps a stage's texture and storage descriptor sections across draws while what they were resolved from stands (gpu/vk), in every scene, draw-heavy ones most; RX_VK_DESC_SECTIONS=0 turns it off (RX_VK_DESC_REFRESH acts only under it). Please start from the kokiri-start save and take the picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between (a picture during the load's fade-in from black is not comparable), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each, and Castle Town Market for two minutes from the market-entrance save, with a picture there taken the same way; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, on) and with RX_VK_DESC_SECTIONS=0 (off), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; with it unset, frame time p99 equal to main's or better, within the run-to-run spread, and equal to RX_VK_DESC_SECTIONS=0 or better. The log must have no FATAL, device lost or validation error line. No stale or wrong texture in any picture.

@Beanstalk This keeps a stage's texture and storage descriptor sections across draws while what they were resolved from stands (gpu/vk), in every scene, draw-heavy ones most; RX_VK_DESC_SECTIONS=0 turns it off (RX_VK_DESC_REFRESH acts only under it). Please start from the kokiri-start save and take the picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between (a picture during the load's fade-in from black is not comparable), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each, and Castle Town Market for two minutes from the market-entrance save, with a picture there taken the same way; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, on) and with RX_VK_DESC_SECTIONS=0 (off), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; with it unset, frame time p99 equal to main's or better, within the run-to-run spread, and equal to RX_VK_DESC_SECTIONS=0 or better. The log must have no FATAL, device lost or validation error line. No stale or wrong texture in any picture.
Member

@siantm only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 65da04c, and the PR has changed since (f124942), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@siantm only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `65da04c`, and the PR has changed since (`f124942`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

Description: Prior work now says #794 measured a loss (its descriptor time slower than main) and what this narrower form leaves out; this PR's own descriptor time is not measured yet (Verdict says the same).

Description: Prior work now says #794 measured a loss (its descriptor time slower than main) and what this narrower form leaves out; this PR's own descriptor time is not measured yet (Verdict says the same).
dazemc left a comment

The switch ships on with no measurement, after #794 measured a loss — make it attempt and off until the A/B.

The body's Measurements says "Verdict: not measured: no micro-benchmark of this port and no run in the game on this PC yet"; the two rows are kill/on (gpu/vk/switches.def), and the checklist's "ships at the default the measurements chose" is unticked. The Prior work names #794, the same idea, whose own A/B measured descriptor time slower than main (3.4–3.9 ms against 2.5–2.9 ms) and was closed. A perf switch whose only prior evidence is a regression should ship off / attempt until the in-game A/B; otherwise every player gets the unmeasured path by default. This is the same pattern as #2212. The code may well win, but the default is a product decision and the measurement is the thing that should make it.

Lifetime, read from the source (not run).

  • Kept: the writer's bufs/imgs/views for the immediately preceding build of the same program, only in the same recording and only over the build that was bound (cb.desc.build == desc_build_no, out.prog == &p, equal counts). Released by another build, a dispatch, a draw left out between build and bind, a new recording/clear/upscaler, the mesh fallback, a frame dump, RX_VK_DESC_REUSE=never, or any failed check.
  • Texture section: tex_gen per stage, texture_destroy_generation() (stored and current), sampler registration generation, texture epoch, slot versions (or the registrations' generation when the row is off), and each resolved texture's gpu_written state. destroy_gen is bumped by destroy_later, compaction and deferred uploads, so destroyed, evicted and reused textures fail the check.
  • Storage section: ssbo_gen per stage, gpu_bind_stamp() (pools_gen and mirror_epoch, the stamp gpu_buffer_bind's own memo uses), and desc_ssbo_again for an unbound buffer or one in a virtual pool. There is no separate buffer destroy generation, but gpu_bind_stamp is the renderer's own binding identity; no path found where a section outlives the buffer it names within a recording.
  • The one raw-pointer use is desc_tex_seen's const Texture*; it is safe only because the destroy-generation checks come first. No texture_alive call, but no reordering issue found in the code.

Test. tests/test_desc_sections.py fails on main because the cut functions/fields do not exist (the extraction raises), so it is more than a switch parse; it runs the rules, both desc_tex_kept/desc_ssbo_kept and the refresh. It covers g_destroy++ and dgen+1, but never a destroyed Texture: texs stay alive, and the only lifetime state it moves is the generation and gpu_written. So a real eviction/reuse/free, and the ordering "destroy generation before the Texture* deref", are untested. Add one case with a dead Texture*/texture_alive (or a comment pinning the order) and one eviction/reuse case.

Off path. Behaviour is main's (same out.reset(), same writes, no refresh), but the cost is not only a branch: st_desc_builds is an atomic add per build, desc_build_no++ a thread-local add, out.has_storage_buffers a write per storage write, desc_tex_dummies an add per dummy, desc_ssbo_again on an unbound buffer. No timer is read. The atomic per build is the one to measure or drop when off.

Pins. Our #1988 texture drain uses the same destroy_gen; sparse shadows use gpu_bind_stamp; #2211 (RX_VK_ASYNC_PARTS) and #2212 (RX_VK_ASYNC_FENCES) touch vk_replay.cpp. No hunk overlap with #2210's vk_draw.cpp/vk_shader.h (rebase only), but an A/B must pin RX_VK_DESC_SECTIONS=0 against unset and those switches on both arms; the frame log's kept-section line is the counter.

No fix claim: the title says perf, and the body does not claim one. The default is the concern, not the wording.

**The switch ships on with no measurement, after #794 measured a loss — make it `attempt` and off until the A/B.** The body's Measurements says "Verdict: not measured: no micro-benchmark of this port and no run in the game on this PC yet"; the two rows are `kill`/on (`gpu/vk/switches.def`), and the checklist's "ships at the default the measurements chose" is unticked. The Prior work names #794, the same idea, whose own A/B measured descriptor time slower than main (3.4–3.9 ms against 2.5–2.9 ms) and was closed. A perf switch whose only prior evidence is a regression should ship off / `attempt` until the in-game A/B; otherwise every player gets the unmeasured path by default. This is the same pattern as #2212. The code may well win, but the default is a product decision and the measurement is the thing that should make it. **Lifetime, read from the source (not run).** - Kept: the writer's `bufs`/`imgs`/`views` for the immediately preceding build of the same program, only in the same recording and only over the build that was bound (`cb.desc.build == desc_build_no`, `out.prog == &p`, equal counts). Released by another build, a dispatch, a draw left out between build and bind, a new recording/clear/upscaler, the mesh fallback, a frame dump, `RX_VK_DESC_REUSE=never`, or any failed check. - Texture section: `tex_gen` per stage, `texture_destroy_generation()` (stored and current), sampler registration generation, texture epoch, slot versions (or the registrations' generation when the row is off), and each resolved texture's `gpu_written` state. `destroy_gen` is bumped by `destroy_later`, compaction and deferred uploads, so destroyed, evicted and reused textures fail the check. - Storage section: `ssbo_gen` per stage, `gpu_bind_stamp()` (`pools_gen` and `mirror_epoch`, the stamp `gpu_buffer_bind`'s own memo uses), and `desc_ssbo_again` for an unbound buffer or one in a virtual pool. There is no separate buffer destroy generation, but `gpu_bind_stamp` is the renderer's own binding identity; no path found where a section outlives the buffer it names within a recording. - The one raw-pointer use is `desc_tex_seen`'s `const Texture*`; it is safe only because the destroy-generation checks come first. No `texture_alive` call, but no reordering issue found in the code. **Test.** `tests/test_desc_sections.py` fails on main because the cut functions/fields do not exist (the extraction raises), so it is more than a switch parse; it runs the rules, both `desc_tex_kept`/`desc_ssbo_kept` and the refresh. It covers `g_destroy++` and `dgen+1`, but never a destroyed `Texture`: `texs` stay alive, and the only lifetime state it moves is the generation and `gpu_written`. So a real eviction/reuse/free, and the ordering "destroy generation before the `Texture*` deref", are untested. Add one case with a dead `Texture*`/`texture_alive` (or a comment pinning the order) and one eviction/reuse case. **Off path.** Behaviour is main's (same `out.reset()`, same writes, no refresh), but the cost is not only a branch: `st_desc_builds` is an atomic add per build, `desc_build_no++` a thread-local add, `out.has_storage_buffers` a write per storage write, `desc_tex_dummies` an add per dummy, `desc_ssbo_again` on an unbound buffer. No timer is read. The atomic per build is the one to measure or drop when off. **Pins.** Our #1988 texture drain uses the same `destroy_gen`; sparse shadows use `gpu_bind_stamp`; #2211 (`RX_VK_ASYNC_PARTS`) and #2212 (`RX_VK_ASYNC_FENCES`) touch `vk_replay.cpp`. No hunk overlap with #2210's `vk_draw.cpp`/`vk_shader.h` (rebase only), but an A/B must pin `RX_VK_DESC_SECTIONS=0` against unset and those switches on both arms; the frame log's kept-section line is the counter. No fix claim: the title says `perf`, and the body does not claim one. The default is the concern, not the wording.
dazemc's review of #2210 (72495): the check's textures stayed alive; only the destroy generation and the GPU-written
state moved. Two cases cut desc_tex_kept from the source as before:
- a texture that went: on a page of its own, taken away (no access) after the destroy generation moved, as
  destroy_later moves it before the texture table lets the Texture go. The check must fail, with the draw's generation
  read before the texture went or after, and never read the Texture: a read ends the run with a FAIL line (a SIGSEGV
  handler), so the check removed, or the pointers read before it, fails the case.
- an eviction whose memory is made into another texture at once: the same address, the same GPU-written state, no slot
  version moved, no stage bound anew. All but the destroy generation is as it was; with it moved the check must fail.
And from vk_texture.cpp: destroy_later moves the generation first, and every erase from the texture table has a
destroy_later before it in its function (nothing else lets a texture go): what the record's pointers rely on.

Assisted-by: Claude Code
perf(vk): RX_VK_DESC_SECTIONS ships off (attempt); off, the descriptor build does none of the sections' work
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
f12494216d
dazemc's review of #2210 (72495). The sectional rebuild is not measured, and dyst's #794, the same idea in a wider form,
measured a loss: it ships off until the in-game A/B. RX_VK_DESC_SECTIONS is an attempt row now: unset or 0 is main's
build and logs nothing when unset; 1 (any value but 0, false, off, no) turns it on. RX_VK_DESC_REFRESH stays on under
it; with the sections off no build keeps a section, so it is never read.

Off, the build and draw() did some of the sections' work besides the switch's test: the shared count of builds
(st_desc_builds, a store to a line every recording thread writes), the build number (desc_build_no, a thread-local add
per build and a read at each bind), two thread-local lookups per build (the kept infos, the texture record), a write per
storage buffer write (has_storage_buffers), an add per dummy texture and a write per unbound storage buffer. Each is
under the switch or a kept section now: off, what is left of the change is the switch's test (a function-local static)
in the build and in draw(), a call reading it at each bind, and branches on it. Not timed.

tests/test_desc_sections.py: the readers' defaults (unset: the sections off with no line, the refresh on), the
diagnostics turning off RX_VK_DESC_SECTIONS=1, the rows' kinds, and a reading of build_descriptors and draw(): every
statement that names the sections' own state (their counters, the build number, the record, the kept infos) is under
the switch or a kept section; each of the ungated statements above fails it.

Assisted-by: Claude Code
siantm changed title from WIP: perf(vk): a draw of the program before it keeps its texture and storage descriptors while their bindings stand (RX_VK_DESC_SECTIONS, on) to WIP: perf(vk): a draw of the program before it keeps its texture and storage descriptors while their bindings stand (RX_VK_DESC_SECTIONS, off) 2026-11-22 08:31:56 +00:00
Author
Contributor

@dazemc thank you for the review (72495). Pushed 6a8299fa and f1249421 on top of 65da04cc (main is still a2dc5385, so no rebase). The description and the title are updated.

  1. Default. f1249421: RX_VK_DESC_SECTIONS is now an attempt row and ships off. Unset or 0 is main's build, and unset logs nothing; 1 turns the sections on. RX_VK_DESC_REFRESH acts only under it: with the sections off no build keeps a section, so the refresh does nothing and is never read. The reader's test covers unset (off), 0/off/false/no (off) and 1/on/any other value (on). The description says the default follows your review and stays off until the in-game comparison exists.

  2. Test gaps. 6a8299fa adds two cases, cut from the source as before:

    • A texture that went. Its Texture is on a page of its own, which is made inaccessible after the destroy generation moves (as destroy_later moves it before the texture table frees the Texture). desc_tex_kept must fail, with the draw's generation read either before or after, and any read of that page stops the run with a FAIL line.
    • An eviction whose memory is made into another texture at once: same address, same GPU-written state, no slot version or stage generation moved. Nothing but the generation tells the two apart, and with it moved the section is not kept.

    The test also reads vk_texture.cpp: destroy_later moves the generation first, and every erase from the texture table has a destroy_later before it in its function. Mutants on copies, each case run alone: without the destroy-generation check, both cases fail; with the gpu_written loop moved to the top of desc_tex_kept, the first one fails; with the destroy_later before one erase removed, the source check fails. 6a8299fa also passes on its own, on the earlier code.

  3. Off path. I dropped it rather than keep and measure it (f1249421). With the switch off, none of these run now: the build count st_desc_builds, the build number (its add, and its read at the bind), the two thread-local lookups per build (the kept infos and the texture record, which your list did not name), the has_storage_buffers write, the dummy add and desc_ssbo_again. Each is under the switch or a kept section. What the off path still adds to main's work is the switch's test, a function-local static, in the build and in draw(), a call to its reader at each bind, and branches on it. I have not timed that remainder. The test now reads build_descriptors and draw() and fails on any statement that names the sections' own state outside the switch or a kept section. Each of the eight statements above, put back outside the switch one at a time, fails it.

  4. Pins. No commit. The held A/B on this PC is now RX_VK_DESC_SECTIONS=0 against =1 in this PR's build, with RX_VK_ASYNC_PARTS and RX_VK_ASYNC_FENCES set the same on both sides and the frame log's kept-section line as the counter (on the =1 side). Still to test says the same. It has not run yet.

Testing (in the description): tests/test_desc_sections.py passes. The 198 checks that read a changed file give 181 passed, 11 failed and 6 skipped (Linux only); the 11 failures are the same 11 that fail on main a2dc5385. vk_draw.cpp compiles with the game build's command.

@dazemc thank you for the review (72495). Pushed 6a8299fa and f1249421 on top of 65da04cc (main is still a2dc5385, so no rebase). The description and the title are updated. 1. **Default.** f1249421: `RX_VK_DESC_SECTIONS` is now an `attempt` row and ships off. Unset or `0` is main's build, and unset logs nothing; `1` turns the sections on. `RX_VK_DESC_REFRESH` acts only under it: with the sections off no build keeps a section, so the refresh does nothing and is never read. The reader's test covers unset (off), `0`/`off`/`false`/`no` (off) and `1`/`on`/any other value (on). The description says the default follows your review and stays off until the in-game comparison exists. 2. **Test gaps.** 6a8299fa adds two cases, cut from the source as before: - A texture that went. Its `Texture` is on a page of its own, which is made inaccessible after the destroy generation moves (as `destroy_later` moves it before the texture table frees the `Texture`). `desc_tex_kept` must fail, with the draw's generation read either before or after, and any read of that page stops the run with a FAIL line. - An eviction whose memory is made into another texture at once: same address, same GPU-written state, no slot version or stage generation moved. Nothing but the generation tells the two apart, and with it moved the section is not kept. The test also reads `vk_texture.cpp`: `destroy_later` moves the generation first, and every erase from the texture table has a `destroy_later` before it in its function. Mutants on copies, each case run alone: without the destroy-generation check, both cases fail; with the `gpu_written` loop moved to the top of `desc_tex_kept`, the first one fails; with the `destroy_later` before one erase removed, the source check fails. 6a8299fa also passes on its own, on the earlier code. 3. **Off path.** I dropped it rather than keep and measure it (f1249421). With the switch off, none of these run now: the build count `st_desc_builds`, the build number (its add, and its read at the bind), the two thread-local lookups per build (the kept infos and the texture record, which your list did not name), the `has_storage_buffers` write, the dummy add and `desc_ssbo_again`. Each is under the switch or a kept section. What the off path still adds to main's work is the switch's test, a function-local static, in the build and in `draw()`, a call to its reader at each bind, and branches on it. I have not timed that remainder. The test now reads `build_descriptors` and `draw()` and fails on any statement that names the sections' own state outside the switch or a kept section. Each of the eight statements above, put back outside the switch one at a time, fails it. 4. **Pins.** No commit. The held A/B on this PC is now `RX_VK_DESC_SECTIONS=0` against `=1` in this PR's build, with `RX_VK_ASYNC_PARTS` and `RX_VK_ASYNC_FENCES` set the same on both sides and the frame log's kept-section line as the counter (on the `=1` side). Still to test says the same. It has not run yet. Testing (in the description): `tests/test_desc_sections.py` passes. The 198 checks that read a changed file give 181 passed, 11 failed and 6 skipped (Linux only); the 11 failures are the same 11 that fail on main a2dc5385. `vk_draw.cpp` compiles with the game build's command.
Author
Contributor

@Beanstalk This replaces my request 71737, made for the earlier head 65da04cc, where the switch was on by default. This adds RX_VK_DESC_SECTIONS, an attempt off by default: with RX_VK_DESC_SECTIONS=1 a stage's texture and storage descriptor sections are kept across draws while what they were resolved from stands (gpu/vk), in every scene, draw-heavy ones most; unset or =0 is main's way (RX_VK_DESC_REFRESH acts only under it). Please start from the kokiri-start save and take the picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between (a picture during the load's fade-in from black is not comparable), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each, and Castle Town Market for two minutes from the market-entrance save, with a picture there taken the same way; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, off) and with RX_VK_DESC_SECTIONS=1 (on), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; unset, frame time p99 equal to main's; with RX_VK_DESC_SECTIONS=1, equal to unset or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line. No stale or wrong texture in any picture.

@Beanstalk This replaces my request 71737, made for the earlier head 65da04cc, where the switch was on by default. This adds RX_VK_DESC_SECTIONS, an attempt off by default: with RX_VK_DESC_SECTIONS=1 a stage's texture and storage descriptor sections are kept across draws while what they were resolved from stands (gpu/vk), in every scene, draw-heavy ones most; unset or =0 is main's way (RX_VK_DESC_REFRESH acts only under it). Please start from the kokiri-start save and take the picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between (a picture during the load's fade-in from black is not comparable), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each, and Castle Town Market for two minutes from the market-entrance save, with a picture there taken the same way; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, off) and with RX_VK_DESC_SECTIONS=1 (on), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; unset, frame time p99 equal to main's; with RX_VK_DESC_SECTIONS=1, equal to unset or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line. No stale or wrong texture in any picture.
Member

@siantm only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@siantm only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/vk-desc-sections:siantm-perf/vk-desc-sections'
git switch 'siantm-perf/vk-desc-sections'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2210
No description provided.