refactor(agc): split Graphics::Draw into a prepare and a record step #8992

Merged
SP4C3B4R-8 merged 1 commit from upstream-pr/8992 into main 2026-10-22 09:47:27 +00:00
SP4C3B4R-8 commented 2026-10-21 08:52:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SP4C3B4R-8 on 2026-10-21T08:52:46Z.


What

Step 1 of the draw-side series asked for in #7895 (@oneandonlydean, issuecomment of 10-19): split Graphics::Draw into a prepare step and a record step, with no behaviour change. It is the draw counterpart of #8278.

Step Function What it does
prepare prepareDraw the stencil-replay checks and timers, the inputs (prepareDrawInputs), the color target bindings (resident lookup or per-draw target), resolveDrawResources and the cache insert, the indirect records' path, the recorded/lean decision, the pipeline and the framebuffer
record recordPreparedDraw the lean path (recordDraw and the draw recipe) or the synchronous path (batch, barriers, render pass, submit, write-back), then the report

The hand-off is a PreparedDraw that holds what used to be Draw's locals, in the same declaration order, so they are destroyed in the same order. TargetBinding moves from Draw's body to the anonymous namespace because PreparedDraw holds the bindings. Draw now builds a PreparedDraw and calls both steps. Both steps keep their code where it was in the file: the diff adds the struct, the two function heads and the alias lines at the cut. Nothing is reordered or moved across the GPU mutex. DrawWithRecipe is unchanged.

The next steps from #7895 build on this cut: moving parts of the prepare step off the committer, then a check at record time that catches writes landing between prepare and record (CPU writes and queued GPU items) and falls back to preparing again. Each will come behind a switch that is off by default, with before/after timings from the same scene and a test that writes in that window.

Tested

Windows 11, RTX 5070 Ti (NVIDIA 617.42), Ryzen 7 7800X3D, MinGW GCC 15.2, Release.
Based on main d6eafa54d (rebased 10-22: the only conflict was the sample-order and depth-location locals that main added at the end of the prepare step; they move into PreparedDraw like the others). The tests below were rerun after the rebase.

  • agc_driver_graphics_tests: passes.
  • The draw execution tests (agc_driver_*draw*, *stencil*, *indirect*, *multisample*, *msaa*, *target*, *pass*): 99 of 99 pass, including the new agc_driver_polygon_mode_draw and agc_driver_msaa_layout (agc_driver_stencil_ref_export skips, as on main).
  • Astro Bot (PPSA21564), Crash Site hub, warm caches: main f894ba69d 10.18 fps, this branch 10.37 fps, which is run-to-run noise. Behaviour is unchanged, so there is no switch.
  • python tools/check_conventions.py --base origin/main: all checks passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: the next draw-side steps of #7895
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4948958498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992). Originally posted by [SP4C3B4R-8](https://github.com/SP4C3B4R-8) on 2026-10-21T08:52:46Z. --- ### What Step 1 of the draw-side series asked for in #7895 (@oneandonlydean, issuecomment of 10-19): split `Graphics::Draw` into a prepare step and a record step, with no behaviour change. It is the draw counterpart of #8278. | Step | Function | What it does | | --- | --- | --- | | prepare | `prepareDraw` | the stencil-replay checks and timers, the inputs (`prepareDrawInputs`), the color target bindings (resident lookup or per-draw target), `resolveDrawResources` and the cache insert, the indirect records' path, the recorded/lean decision, the pipeline and the framebuffer | | record | `recordPreparedDraw` | the lean path (`recordDraw` and the draw recipe) or the synchronous path (batch, barriers, render pass, submit, write-back), then the report | The hand-off is a `PreparedDraw` that holds what used to be `Draw`'s locals, in the same declaration order, so they are destroyed in the same order. `TargetBinding` moves from `Draw`'s body to the anonymous namespace because `PreparedDraw` holds the bindings. `Draw` now builds a `PreparedDraw` and calls both steps. Both steps keep their code where it was in the file: the diff adds the struct, the two function heads and the alias lines at the cut. Nothing is reordered or moved across the GPU mutex. `DrawWithRecipe` is unchanged. The next steps from #7895 build on this cut: moving parts of the prepare step off the committer, then a check at record time that catches writes landing between prepare and record (CPU writes and queued GPU items) and falls back to preparing again. Each will come behind a switch that is off by default, with before/after timings from the same scene and a test that writes in that window. ### Tested Windows 11, RTX 5070 Ti (NVIDIA 617.42), Ryzen 7 7800X3D, MinGW GCC 15.2, Release. Based on `main` d6eafa54d (rebased 10-22: the only conflict was the sample-order and depth-location locals that `main` added at the end of the prepare step; they move into `PreparedDraw` like the others). The tests below were rerun after the rebase. - `agc_driver_graphics_tests`: passes. - The draw execution tests (`agc_driver_*draw*`, `*stencil*`, `*indirect*`, `*multisample*`, `*msaa*`, `*target*`, `*pass*`): 99 of 99 pass, including the new `agc_driver_polygon_mode_draw` and `agc_driver_msaa_layout` (`agc_driver_stencil_ref_export` skips, as on `main`). - Astro Bot (PPSA21564), Crash Site hub, warm caches: `main` f894ba69d 10.18 fps, this branch 10.37 fps, which is run-to-run noise. Behaviour is unchanged, so there is no switch. - `python tools/check_conventions.py --base origin/main`: all checks passed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: the next draw-side steps of #7895 - [x] GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 - [x] AI-assisted: yes (Claude Code)
clairtonmichel commented 2026-10-21 08:57:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-21T08:57:18Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (RADV NAVI31, Fedora Linux, Mesa 26.2.5):

  • Built cleanly with zero errors.
  • Ran the full AGC graphics test suite (~627 tests): 99% passed successfully.
  • The refactoring of Graphics::Draw into preparation and recording stages introduces zero regressions on host. (The 3 failing tests are the known RADV/Mesa edge cases: guest_memory_lifetime, image_array_window_past_layer_limit, and tessellation).
  • Great architectural refactor!
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312082508 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6312082508). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-21T08:57:18Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (RADV NAVI31, Fedora Linux, Mesa 26.2.5): - Built cleanly with zero errors. - Ran the full AGC graphics test suite (~627 tests): 99% passed successfully. - The refactoring of `Graphics::Draw` into preparation and recording stages introduces zero regressions on host. (The 3 failing tests are the known RADV/Mesa edge cases: `guest_memory_lifetime`, `image_array_window_past_layer_limit`, and `tessellation`). - Great architectural refactor!
github-actions[bot] commented 2026-10-21 09:36:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T09:36:01Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2150-2152
PR 6959 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2151-2152
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2176-2177
PR 9202 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2200-2228
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2151-2152
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2151-2152
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L2176-2177

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 8999 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312794250 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6312794250). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T09:36:01Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6612](https://www.github.com/boykopovar/AnyPS5/pull/6612) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2150-2152](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2150-L2152) | | | | [PR 6959](https://www.github.com/boykopovar/AnyPS5/pull/6959) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2151-2152](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2151-L2152) | | | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2176-2177](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2176-L2177) | | | | [PR 9202](https://www.github.com/boykopovar/AnyPS5/pull/9202) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2200-2228](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2200-L2228) | | | | [PR 9356](https://www.github.com/boykopovar/AnyPS5/pull/9356) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2151-2152](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2151-L2152) | | | | [PR 9387](https://www.github.com/boykopovar/AnyPS5/pull/9387) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2151-2152](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2151-L2152) | | | | [PR 9508](https://www.github.com/boykopovar/AnyPS5/pull/9508) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L2176-2177](https://github.com/boykopovar/AnyPS5/blob/7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2176-L2177) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 7275](https://www.github.com/boykopovar/AnyPS5/pull/7275) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 8246](https://www.github.com/boykopovar/AnyPS5/pull/8246) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 8999](https://www.github.com/boykopovar/AnyPS5/pull/8999) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` |
teepean commented 2026-10-21 13:39:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by teepean on 2026-10-21T13:39:47Z.


@SP4C3B4R-8 #8992 on Stray (PPSA02100), as promised in #7895. Short version: identical output and the same timings within noise.

Setup

  • Linux (CachyOS, kernel 7.2.10, scx_lavd), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), GCC 16.2.1, Release.
  • main b5d763770a against main b5d763770a + this PR (head 5f3466bd70, merged without conflicts).
  • Stray at the start of the Dead City chapter, 3840x2160, stock engine.ini, scripted input. Only APS5_TRACE_SECONDS=185:20 set, one run at a time, 8 rounds with the order alternating; the numbers are from tools/trace_digest.py.

Tests
The 51 draw-related tests (agc_driver_*draw*, *stencil*, *indirect*, *multisample*, *msaa*, *target*, *pass*, and agc_driver_graphics_tests) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1:

  • 50 pass with no VUIDs, agc_driver_draw_pipeline_trace in both variants with ctest's environment.
  • agc_driver_stencil_ref_export skips: the driver here has no VK_EXT_shader_stencil_export.

Timing (ms; runs in the slow state below are left out)

main this PR
runs kept 6 5
frame p50 178.4 177.6
GPU busy per present 55.9 53.9
draw committer busy per frame 50.2 49.8
  • Frame p50 of each run: main 173.4, 181.5, 181.4, 166.3, 191.5, 176.5; this PR 153.0, 178.3, 199.3, 185.8, 171.6.
  • As on main before, queue 0's worker bounds this scene, and the committer is busy about 29 % of the frame in every kept run of both builds.
  • 5 of the 16 runs (2 of main, 3 of this PR) spent the whole window in a state where a frame takes about 1 s. In it, queue 0's worker is 95 % busy and the committer 80-85 %, both about 15 times their usual time per frame. Plain main falls into it too (I also saw it on main 7e95bde794 and 5f7e30233e), so it isn't this PR. I'll look into it separately.

Frames
Frame dumps (APS5_DUMP_FRAMES=40, every 104 presents), two runs of each build, compared over frames 26-37:

  • main's second run against both runs of this PR: frames 26-32 mean 0.0-1.1, at most 0.04 % of pixels off by more than 64.
  • Frames 33-37 differ by mean 3.5-5.4 (at most 0.9 % of pixels), and by as much between the two runs of this PR. At about 6 FPS the dump points move a little in game time from run to run.
  • main's first run differs from all three other runs in frames 28-31, by about 20 % of pixels. The other three runs agree there.

So the comparison shows no difference between the builds beyond what two runs of one build show. Traces and digests are available on request.

AI-assisted: yes (text with Claude Code; the numbers are from my machine).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6317519314 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6317519314). Originally posted by [teepean](https://github.com/teepean) on 2026-10-21T13:39:47Z. --- @SP4C3B4R-8 #8992 on Stray (PPSA02100), as promised in #7895. Short version: identical output and the same timings within noise. **Setup** - Linux (CachyOS, kernel 7.2.10, scx_lavd), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), GCC 16.2.1, Release. - `main` b5d763770a against `main` b5d763770a + this PR (head 5f3466bd70, merged without conflicts). - Stray at the start of the Dead City chapter, 3840x2160, stock `engine.ini`, scripted input. Only `APS5_TRACE_SECONDS=185:20` set, one run at a time, 8 rounds with the order alternating; the numbers are from `tools/trace_digest.py`. **Tests** The 51 draw-related tests (`agc_driver_*draw*`, `*stencil*`, `*indirect*`, `*multisample*`, `*msaa*`, `*target*`, `*pass*`, and `agc_driver_graphics_tests`) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1`: - 50 pass with no VUIDs, `agc_driver_draw_pipeline_trace` in both variants with ctest's environment. - `agc_driver_stencil_ref_export` skips: the driver here has no `VK_EXT_shader_stencil_export`. **Timing** (ms; runs in the slow state below are left out) | | `main` | this PR | |---|---|---| | runs kept | 6 | 5 | | frame p50 | 178.4 | 177.6 | | GPU busy per present | 55.9 | 53.9 | | draw committer busy per frame | 50.2 | 49.8 | - Frame p50 of each run: `main` 173.4, 181.5, 181.4, 166.3, 191.5, 176.5; this PR 153.0, 178.3, 199.3, 185.8, 171.6. - As on `main` before, queue 0's worker bounds this scene, and the committer is busy about 29 % of the frame in every kept run of both builds. - 5 of the 16 runs (2 of `main`, 3 of this PR) spent the whole window in a state where a frame takes about 1 s. In it, queue 0's worker is 95 % busy and the committer 80-85 %, both about 15 times their usual time per frame. Plain `main` falls into it too (I also saw it on `main` 7e95bde794 and 5f7e30233e), so it isn't this PR. I'll look into it separately. **Frames** Frame dumps (`APS5_DUMP_FRAMES=40`, every 104 presents), two runs of each build, compared over frames 26-37: - `main`'s second run against both runs of this PR: frames 26-32 mean 0.0-1.1, at most 0.04 % of pixels off by more than 64. - Frames 33-37 differ by mean 3.5-5.4 (at most 0.9 % of pixels), and by as much between the two runs of this PR. At about 6 FPS the dump points move a little in game time from run to run. - `main`'s first run differs from all three other runs in frames 28-31, by about 20 % of pixels. The other three runs agree there. So the comparison shows no difference between the builds beyond what two runs of one build show. Traces and digests are available on request. AI-assisted: yes (text with Claude Code; the numbers are from my machine).
SP4C3B4R-8 commented 2026-10-22 08:10:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SP4C3B4R-8 on 2026-10-22T08:10:51Z.


@teepean @clairtonmichel thanks for the runs: identical frames and timings within noise on Stray, and no regressions on RADV, which is the bar @oneandonlydean set for this step.

Rebased on main d6eafa54d (it was conflicting). The only conflict was the sample-order and depth-location locals that main added at the end of the prepare step; they now live in PreparedDraw like the other locals, and the record step reads them from there. The draw tests were rerun on the rebase: 99 of 99 pass, including the new agc_driver_polygon_mode_draw and agc_driver_msaa_layout. The description is updated.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6335994671 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6335994671). Originally posted by [SP4C3B4R-8](https://github.com/SP4C3B4R-8) on 2026-10-22T08:10:51Z. --- @teepean @clairtonmichel thanks for the runs: identical frames and timings within noise on Stray, and no regressions on RADV, which is the bar @oneandonlydean set for this step. Rebased on `main` d6eafa54d (it was conflicting). The only conflict was the sample-order and depth-location locals that `main` added at the end of the prepare step; they now live in `PreparedDraw` like the other locals, and the record step reads them from there. The draw tests were rerun on the rebase: 99 of 99 pass, including the new `agc_driver_polygon_mode_draw` and `agc_driver_msaa_layout`. The description is updated. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-22 08:30:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T08:30:11Z.


@SP4C3B4R-8, thanks for the rebase and the runs. I read it against the step-1 bar and it's a pure move: each local becomes a PreparedDraw member in its old declaration order (so destruction order is unchanged), the early exits return false where they returned before, and the rebased locals (reordered, reorderPass, depthLocations) moved correctly.

One small ask before merge, about profiling only: DrawTimer now starts when PreparedDraw is built at the top of Draw, before recorder->BoundKeptBytes(), which can submit or finish batches and so wait on the GPU. With APS5_PROFILE_DRAW set, the first phase (PhaseSetup) and the [draws] totals now include that wait. Without the variable nothing changes, so the frame-time runs can't show it. Could you start the timer at its old point again, for example timer = DrawTimer(profile); where DrawTimer timer(profile); used to be? The later steps of the outline will be measured with that profile, so it should match main here.

After that push, I'll run full CI on the new head and merge once it's green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336349262 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6336349262). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-22T08:30:11Z. --- @SP4C3B4R-8, thanks for the rebase and the runs. I read it against the step-1 bar and it's a pure move: each local becomes a `PreparedDraw` member in its old declaration order (so destruction order is unchanged), the early exits return false where they returned before, and the rebased locals (`reordered`, `reorderPass`, `depthLocations`) moved correctly. One small ask before merge, about profiling only: `DrawTimer` now starts when `PreparedDraw` is built at the top of `Draw`, before `recorder->BoundKeptBytes()`, which can submit or finish batches and so wait on the GPU. With `APS5_PROFILE_DRAW` set, the first phase (`PhaseSetup`) and the `[draws]` totals now include that wait. Without the variable nothing changes, so the frame-time runs can't show it. Could you start the timer at its old point again, for example `timer = DrawTimer(profile);` where `DrawTimer timer(profile);` used to be? The later steps of the outline will be measured with that profile, so it should match `main` here. After that push, I'll run full CI on the new head and merge once it's green.
SP4C3B4R-8 commented 2026-10-22 09:18:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SP4C3B4R-8 on 2026-10-22T09:18:40Z.


@oneandonlydean done in 930b9640d: prepareDraw restarts the timer with timer = DrawTimer(profile); right where DrawTimer timer(profile); was on main, after BoundKeptBytes() and the Graphics.Draw timing. So PhaseSetup and the [draws] totals no longer include that wait. The draw tests pass again on the new head (100 of 100 with the graphics tests), and conventions pass.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337253485 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6337253485). Originally posted by [SP4C3B4R-8](https://github.com/SP4C3B4R-8) on 2026-10-22T09:18:40Z. --- @oneandonlydean done in 930b9640d: `prepareDraw` restarts the timer with `timer = DrawTimer(profile);` right where `DrawTimer timer(profile);` was on `main`, after `BoundKeptBytes()` and the `Graphics.Draw` timing. So `PhaseSetup` and the `[draws]` totals no longer include that wait. The draw tests pass again on the new head (100 of 100 with the graphics tests), and conventions pass. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-22 09:47:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T09:47:43Z.


@SP4C3B4R-8, merged, thanks. Full CI on 930b964 was green on Linux and Windows, and the timer fix keeps the draw profile output the same as on main, so the later steps of the #7895 outline can be measured against it. Thanks also to @teepean and @clairtonmichel for the runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337796611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8992#issuecomment-6337796611). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-22T09:47:43Z. --- @SP4C3B4R-8, merged, thanks. Full CI on 930b964 was green on Linux and Windows, and the timer fix keeps the draw profile output the same as on `main`, so the later steps of the #7895 outline can be measured against it. Thanks also to @teepean and @clairtonmichel for the runs.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8992
No description provided.