Skip to content

perf(agc): read an indirect draw's records on the CPU when no unfinished batch writes them - #18670

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
oneandonlydean:perf/agc-settled-indirect-read
Nov 14, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
oneandonlydean:perf/agc-settled-indirect-read

Conversation

@oneandonlydean

@oneandonlydean oneandonlydean commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What

An indirect draw whose records no unfinished batch writes now has them read on the CPU and is recorded as plain draws, instead of taking the GPU-side path.

The GPU-side path records the argument barrier outside a render pass, and when a rule fixes the vertex or the instance count it also copies the records to a scratch buffer and patches them there (a copy, a vkCmdUpdateBuffer per record and two more barriers). Nothing of that may sit inside a pass, so every such draw ends the open pass and begins its own. On PPSA21564 that is the whole forced count of the [draws] profile line: 72k to 80k of about 100k passes begun per 10 s, and about 460k of 610k recorded barriers.

The GPU has to read the records only while something still writes them. Recorder::PendingWriteSettled says when that is over: no write over the range in the open batch, and every in-flight batch that writes it has signaled. The records in guest memory are final then, so the draw takes the existing CPU path (the one used for records that are not imported or have a label pending) and continues the open pass. Records a dispatch or an address-based build still writes stay on the GPU-side path as before. A count buffer keeps the GPU-side path together with its records. APS5_NO_SETTLED_INDIRECT_READ=1 restores the previous behaviour; the profile line lists the new case as records settled.

Tested

Linux, RTX 4090 (24 GB), NVIDIA 610.57.04, i9-14900KF, PPSA21564 01.007.000, 3840x2160, -lvl big_hand_pirate_island, no input, 300 s per arm, three paired rounds, each in an exclusive window with a cold shader cache per arm, APS5_PROFILE_DRAW=1 APS5_TRACE_SUMMARY_EVERY=10. Both arms are one build (main 8ee20ce plus this change): arm A sets APS5_NO_SETTLED_INDIRECT_READ=1, arm B is the default. Medians of the last twelve 10 s windows:

per 10 s unless noted A r1 B r1 A r2 B r2 A r3 B r3
render passes begun 110990 26949 99826 29142 102098 29555
of them forced 79950 1601 72300 3524 73450 3328
barriers recorded 664028 209789 614761 226664 610768 224250
indirect draws GPU-side 90989 2489 82079 4530 83753 4348
indirect draws read settled 0 83588 0 87600 0 73893
GPU busy per present 100.3 ms 76.1 ms 100.3 ms 72.9 ms 97.5 ms 75.0 ms
frame p50 260.1 ms 269.3 ms 263.5 ms 264.4 ms 264.0 ms 258.4 ms

GPU time per present falls by about a quarter. The frame time does not move (+3.5%, +0.3%, -2.1%, around the 3% run-to-run spread of this scene): the scene is limited by the per-draw work of the queue 0 worker, not by the GPU, so the gain shows where the GPU is the limit. Dumped frames show the level in both arms of every round; no crash, device loss or abort in any run log.

agc_driver_rect_list_indirect keeps covering the GPU-side path (it sets the switch), and the new agc_driver_settled_indirect_read runs the same draws over settled records and requires the same bytes as the direct draws. The 31 execution tests that touch indirect draws, draw-cache reuse or pass breaks pass on the RTX 4090; the rest of the suite was not run locally.

Not tested: AMD or Intel GPUs, Windows, other titles.

Capture lines for the perf numbers missing label: one run per commit in one exclusive window, same machine and scene as above, shader cache warmed by a run of the same build first, only APS5_TRACE_SECONDS=210:60 set. First line main a6fbf9c (the merge base), second line this head bc68b03. GPU busy per present 107.1 ms to 81.0 ms, as in the rounds above. It is one run per commit, so the paired rounds above stay the frame-time evidence (p50 233.6 ms and 219.2 ms here).

{"commit":"a6fbf9ce9632","dirty":false,"env":{"APS5_TRACE_SECONDS":"210:60"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 610.57.04","os":"Linux 7.2.3-1-cachyos","cpu":"Intel(R) Core(TM) i9-14900KF","cpu_threads":32,"memory_mib":64118,"title_id":"PPSA21564","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 210:60","first_present":2461,"ms":60163.308},"presents":255,"frame_ms":{"p50":233.629,"p90":244.556,"p99":385.935,"max":652.123},"gpu_busy_ms_per_present":107.113,"worker_busy_pct":{"queue worker 0x0":98.471,"queue worker 0x48":94.58,"queue worker 0x40":99.709,"queue worker 0x46":0.212},"phase_totals_ms":{"Driver.Completion":17.951,"Driver.Dispatch":4856.47,"Driver.Dispatch.capture_resources":295.08,"Driver.Dispatch.decode_key_device_setup":59.694,"Driver.Dispatch.lookup_cache":60.847,"Driver.Dispatch.materialize":25.611,"Driver.Dispatch.prepared_invocation":21.197,"Driver.Draw":40769.28,"Driver.Draw.device_setup":1828.631,"Driver.Draw.draw_enqueued":14621.109,"Driver.Draw.post_compile_prepare":230.952,"Driver.Draw.prepare":4198.234,"Driver.Draw.shader_compile_and_link":18803.97,"Driver.EndSubmission":203.544,"Driver.Packet":176039.495,"Driver.Packet.device_lock":240.49,"Driver.Packet.dispatch":5935.952,"Driver.Packet.draw":41167.541,"Driver.Packet.execute":1830.961,"Driver.Packet.flip_flush":7.836,"Driver.Packet.flush_between_packets":738.331,"Driver.Packet.memory_wait":113546.235,"Driver.Packet.pipeline_drain":325.209,"Driver.Packet.pipeline_prepare":345.314,"Driver.Packet.prepare_memory":2672.856,"Driver.Packet.rendering_wait":0.238,"Driver.Present":134.292,"Driver.Present.acquire_image":6.038,"Driver.Present.device_setup":0.122,"Driver.Present.gpu_mutex_wait":0.343,"Driver.Present.inflight_wait":0.396,"Driver.Present.present_display_buffer":22.977,"Driver.Present.queue_present":63.722,"Driver.Present.release_and_callback":0.187,"Driver.Present.render_fence_wait":40.088,"Driver.Present.resize":0.243,"Driver.Present.validate":0.062,"Driver.Suspend":0.046,"GpuMutex.wait.dispatch":296.202,"GpuMutex.wait.draw":516.37,"GpuMutex.wait.end":37.57,"GpuMutex.wait.fill":0.57,"GpuMutex.wait.flush":164.155,"GpuMutex.wait.hook":24.02,"GpuMutex.wait.indirect":7.623,"GpuMutex.wait.label":328.785,"GpuMutex.wait.other":0.0,"GpuMutex.wait.present":0.107,"GpuMutex.wait.wait":16.481,"Graphics.Draw":38721.646,"Graphics.Draw.draw_and_resource_release":32381.936,"Graphics.Draw.index_upload":1298.368,"Graphics.Draw.validate":2678.066,"Graphics.Draw.vertex_upload":1940.665,"Graphics.DrawWithRecipe":52.927,"Graphics.DrawWithRecipe.draw_and_resource_release":4.824,"Graphics.DrawWithRecipe.index_upload":0.082,"Graphics.DrawWithRecipe.validate":0.13,"Graphics.DrawWithRecipe.vertex_upload":0.596,"Recorder.Reap":895.674,"Recorder.Submit":2372.1,"Recorder.WaitSerial":1098.519,"Resources.Complete":3577.873,"Resources.Prepare":6029.233,"Shader.DrawStage":13897.972,"Shader.DrawStage.capture_resources":10099.529,"Shader.DrawStage.materialize":2584.204,"Shader.DrawStage.prepared_invocation":1138.901,"Shader.ResolveAbi":40.995,"Shader.ResolveGraphicsAbi":14.571,"Shader.ResolveGraphicsStagesAbi":435.426,"VideoOut.Flip":143.988,"VideoOut.Flip.completion_mutex_wait":0.119,"VideoOut.Flip.config_mutex_wait":0.019,"VideoOut.Flip.frame_limit":0.097,"VideoOut.Flip.notify_game":6.285,"VideoOut.Flip.present":134.398,"VideoOut.Flip.validate":0.194,"VideoOut.Flip.vblank_wait":0.137,"VideoOut.Flip.window_prepare":0.27,"VideoOut.Flip.window_title":2.382,"VideoOut.Readiness":0.363,"VideoOut.Readiness.locks_validate":0.178,"Vulkan.Acquire":5.705,"Vulkan.Acquire.acquire_fence_wait":1.131,"Vulkan.Acquire.acquire_image":3.145,"Vulkan.Acquire.fence_reset":1.242,"Vulkan.Acquire.retired_swapchains":0.12,"Vulkan.Dispatch":1218.907,"Vulkan.Dispatch.command_record":226.99,"Vulkan.Dispatch.shader_resources":986.073,"Vulkan.DispatchRecipe":112.509,"Vulkan.DispatchRecipe.command_record":111.716,"Vulkan.DrawFromRecipe":53.021,"Vulkan.GraphicsPipeline":564.054,"Vulkan.GraphicsPipeline.create":558.912,"Vulkan.GraphicsPipeline.modules_and_state":5.119,"Vulkan.GraphicsPipelineLibrary":557.549,"Vulkan.GraphicsPipelineLink":0.125,"Vulkan.Present":19.448,"Vulkan.Present.command_record_scale":6.322,"Vulkan.Present.pixel_upload":0.44,"Vulkan.Present.queue_submit":12.555,"Vulkan.QueuePresent":63.463,"Vulkan.QueuePresent.queue_present":63.208,"Vulkan.Retire":39.475,"Vulkan.Retire.wait":36.259},"top_phases_ms_per_frame":{"Driver.Packet":690.351,"Driver.Packet.memory_wait":445.279,"Driver.Packet.draw":161.441,"Driver.Draw":159.88,"Graphics.Draw":151.85,"Graphics.Draw.draw_and_resource_release":126.988,"Driver.Draw.shader_compile_and_link":73.741,"Driver.Draw.draw_enqueued":57.338},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.087,"events_lost":2262257,"totals_full":false},"draw committer":{"events_full_after_s":13.833,"events_lost":863956,"totals_full":false}},"trace":"aps5-trace-a6fbf9ce9632-2660090.json.gz"}
{"commit":"bc68b033d183","dirty":false,"env":{"APS5_TRACE_SECONDS":"210:60"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 610.57.04","os":"Linux 7.2.3-1-cachyos","cpu":"Intel(R) Core(TM) i9-14900KF","cpu_threads":32,"memory_mib":64118,"title_id":"PPSA21564","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 210:60","first_present":2395,"ms":60020.025},"presents":270,"frame_ms":{"p50":219.218,"p90":227.412,"p99":364.201,"max":479.333},"gpu_busy_ms_per_present":81.034,"worker_busy_pct":{"queue worker 0x0":98.274,"queue worker 0x48":94.499,"queue worker 0x40":99.641,"queue worker 0x46":0.282},"phase_totals_ms":{"Driver.Completion":18.066,"Driver.Dispatch":4572.183,"Driver.Dispatch.capture_resources":292.136,"Driver.Dispatch.decode_key_device_setup":63.399,"Driver.Dispatch.lookup_cache":65.331,"Driver.Dispatch.materialize":26.765,"Driver.Dispatch.prepared_invocation":22.001,"Driver.Draw":40101.708,"Driver.Draw.device_setup":1958.695,"Driver.Draw.draw_enqueued":12929.495,"Driver.Draw.post_compile_prepare":227.877,"Driver.Draw.prepare":4379.575,"Driver.Draw.shader_compile_and_link":19575.325,"Driver.EndSubmission":202.163,"Driver.Packet":175456.663,"Driver.Packet.device_lock":256.637,"Driver.Packet.dispatch":5586.947,"Driver.Packet.draw":40510.893,"Driver.Packet.execute":2372.969,"Driver.Packet.flip_flush":12.684,"Driver.Packet.flush_between_packets":777.686,"Driver.Packet.memory_wait":113336.852,"Driver.Packet.pipeline_drain":367.766,"Driver.Packet.pipeline_prepare":365.804,"Driver.Packet.prepare_memory":2460.165,"Driver.Packet.rendering_wait":0.26,"Driver.Present":142.373,"Driver.Present.acquire_image":6.856,"Driver.Present.device_setup":0.132,"Driver.Present.gpu_mutex_wait":0.469,"Driver.Present.inflight_wait":0.417,"Driver.Present.present_display_buffer":27.86,"Driver.Present.queue_present":66.438,"Driver.Present.release_and_callback":0.168,"Driver.Present.render_fence_wait":39.586,"Driver.Present.resize":0.272,"Driver.Present.validate":0.066,"Driver.Suspend":0.104,"GpuMutex.wait.dispatch":357.906,"GpuMutex.wait.draw":521.397,"GpuMutex.wait.end":43.24,"GpuMutex.wait.fill":2.574,"GpuMutex.wait.flush":73.511,"GpuMutex.wait.hook":22.601,"GpuMutex.wait.indirect":6.439,"GpuMutex.wait.label":337.682,"GpuMutex.wait.present":0.219,"GpuMutex.wait.wait":13.135,"Graphics.Draw":36427.606,"Graphics.Draw.draw_and_resource_release":27936.709,"Graphics.Draw.index_upload":1312.796,"Graphics.Draw.validate":2828.473,"Graphics.Draw.vertex_upload":1766.06,"Graphics.DrawWithRecipe":100.212,"Graphics.DrawWithRecipe.draw_and_resource_release":6.624,"Graphics.DrawWithRecipe.index_upload":0.116,"Graphics.DrawWithRecipe.validate":0.177,"Graphics.DrawWithRecipe.vertex_upload":0.743,"Recorder.Reap":859.693,"Recorder.Submit":2127.073,"Recorder.WaitSerial":1036.048,"Resources.Complete":3265.968,"Resources.Prepare":5318.323,"Shader.DrawStage":14549.375,"Shader.DrawStage.capture_resources":10648.895,"Shader.DrawStage.materialize":2628.658,"Shader.DrawStage.prepared_invocation":1191.946,"Shader.ResolveAbi":48.267,"Shader.ResolveGraphicsAbi":17.135,"Shader.ResolveGraphicsStagesAbi":505.912,"VideoOut.Flip":148.529,"VideoOut.Flip.completion_mutex_wait":0.111,"VideoOut.Flip.config_mutex_wait":0.02,"VideoOut.Flip.frame_limit":0.107,"VideoOut.Flip.notify_game":3.476,"VideoOut.Flip.present":142.22,"VideoOut.Flip.validate":0.226,"VideoOut.Flip.vblank_wait":0.14,"VideoOut.Flip.window_prepare":0.279,"VideoOut.Flip.window_title":1.882,"VideoOut.Readiness":0.394,"VideoOut.Readiness.locks_validate":0.205,"Vulkan.Acquire":6.079,"Vulkan.Acquire.acquire_fence_wait":1.19,"Vulkan.Acquire.acquire_image":3.413,"Vulkan.Acquire.fence_reset":1.359,"Vulkan.Acquire.retired_swapchains":0.07,"Vulkan.Dispatch":1198.176,"Vulkan.Dispatch.command_record":241.336,"Vulkan.Dispatch.shader_resources":950.715,"Vulkan.DispatchRecipe":115.888,"Vulkan.DispatchRecipe.command_record":115.057,"Vulkan.DrawFromRecipe":100.332,"Vulkan.GraphicsPipeline":380.116,"Vulkan.GraphicsPipeline.create":377.56,"Vulkan.GraphicsPipeline.modules_and_state":2.537,"Vulkan.GraphicsPipelineLibrary":377.33,"Vulkan.GraphicsPipelineLink":0.089,"Vulkan.Present":24.209,"Vulkan.Present.command_record_scale":6.944,"Vulkan.Present.pixel_upload":0.463,"Vulkan.Present.queue_submit":16.689,"Vulkan.QueuePresent":66.185,"Vulkan.QueuePresent.queue_present":65.941,"Vulkan.Retire":39.169,"Vulkan.Retire.wait":35.324},"top_phases_ms_per_frame":{"Driver.Packet":649.839,"Driver.Packet.memory_wait":419.766,"Driver.Packet.draw":150.04,"Driver.Draw":148.525,"Graphics.Draw":134.917,"Graphics.Draw.draw_and_resource_release":103.469,"Driver.Draw.shader_compile_and_link":72.501,"Shader.DrawStage":53.887},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.03,"events_lost":2074070,"totals_full":false},"draw committer":{"events_full_after_s":18.886,"events_lost":598353,"totals_full":false}},"trace":"aps5-trace-bc68b033d183-2682686.json.gz"}

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: none
  • GPUs tested: NVIDIA RTX 4090, driver 610.57.04, Linux
  • AI-assisted: yes

…hed batch writes them

A GPU-side indirect draw records its argument barrier, and for a fixed vertex or instance count a scratch copy, outside a render pass, so each one begins a pass of its own. When no open or unsignaled batch writes the record range the records in guest memory are final, so the CPU reads them and records plain draws that continue the open pass. APS5_NO_SETTLED_INDIRECT_READ keeps the GPU-side path.
@github-actions github-actions Bot added docs agc libSceAgc* perf Performance change perf numbers missing perf pull request without a before and after summary line labels Nov 12, 2026
@github-actions

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

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 19620 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp L140
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L743

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 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 4472 docs/dev/ENVIRONMENT.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6186 docs/dev/ENVIRONMENT.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7085 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
docs/dev/ENVIRONMENT.md
PR 7449 docs/dev/ENVIRONMENT.md
PR 7457 docs/dev/ENVIRONMENT.md
PR 7514 docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 7643 docs/dev/ENVIRONMENT.md
PR 8004 docs/dev/ENVIRONMENT.md
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 10351 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 10678 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 10757 docs/dev/ENVIRONMENT.md
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 12324 docs/dev/ENVIRONMENT.md
PR 12746 docs/dev/ENVIRONMENT.md
PR 12840 docs/dev/ENVIRONMENT.md
PR 12849 docs/dev/ENVIRONMENT.md
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 15456 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 15529 docs/dev/ENVIRONMENT.md
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 16115 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 16354 docs/dev/ENVIRONMENT.md
PR 16371 docs/dev/ENVIRONMENT.md
PR 16372 docs/dev/ENVIRONMENT.md
PR 16753 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 16760 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 16793 docs/dev/ENVIRONMENT.md
PR 17024 docs/dev/ENVIRONMENT.md
PR 17557 docs/dev/ENVIRONMENT.md
PR 17558 docs/dev/ENVIRONMENT.md
PR 17611 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 17719 docs/dev/ENVIRONMENT.md
PR 17729 docs/dev/ENVIRONMENT.md
PR 17786 docs/dev/ENVIRONMENT.md
PR 17796 docs/dev/ENVIRONMENT.md
PR 17943 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 18029 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 18078 docs/dev/ENVIRONMENT.md
PR 18082 docs/dev/ENVIRONMENT.md
PR 18173 docs/dev/ENVIRONMENT.md
PR 18226 docs/dev/ENVIRONMENT.md
PR 18287 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 18390 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 18515 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 19100 core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 19119 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 19373 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 19697 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md

@JJenkx

JJenkx commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Windows check of head f17a7f35f8, merged onto main cb29c3fc4b (GPU merge b2d5791be9; CPU merge f3c744f12d). Setup: Windows 11 Enterprise 22621, AMD RX 6700 XT, AMD driver 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release.

agc_driver_rect_list_indirect and agc_driver_settled_indirect_read:

  • GPU, through the shared Windows GPU FIFO with ANYPS5_REQUIRE_VULKAN=1: both passed in 3 of 3 runs, 6 of 6 outcomes. The binaries matched the hashes recorded at preparation, and the receipt shows exit 0 and app_count=0.
  • CPU, Vulkan hidden: both skipped (they need a device), 0 failed, in 3 of 3 runs.

These are correctness results only; I made no timing measurement.

AI-assisted: yes.

@mrfelek

mrfelek commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@oneandonlydean a main/PR pair of head f17a7f35f8 in PPSA21564 (01.007.000) -lvl big_hand_pirate_island on two more GPUs. The forced render passes go away on both, as described, but the frame rate doesn't improve on either.

Arms: A = main 181967a53c, B = this head merged onto it (clean merge). Each machine builds both arms in one tree and runs them from the same runtime.

Setup:

  • No input, APS5_PROFILE_DRAW=1 APS5_TRACE_SUMMARY_EVERY=10, run until 300 s after Level has started, stopped by PID.
  • Order: warm-up A, warm-up B, then A1, B1, A2, B2 (the desktop also ran A3, B3). Warm-ups are not counted.
  • Numbers are over the summary windows that end 60–280 s after the level start (11–19 windows per run): the mean FPS and the medians of frame p50 and GPU busy per present. Passes and forced are medians of the last 30 [draws] lines.

Desktop: Linux 7.3, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), 3840x2160, headless.

run FPS frame p50 ms GPU busy ms/present passes / 10 s forced
A1 0.201 5450 1260 6444 3370
B1 0.157 6576 1620 2045 7
A2 0.191 6824 1899 5346 2584
B2 0.211 4839 1319 2844 16
A3 0.244 5415 1408 7165 4250
B3 0.190 6751 1601 2496 16

AMD iGPU: Ubuntu 26.04 (kernel 7.0), Ryzen 9 PRO 8945HS, Radeon 780M (RADV, Mesa 26.0.8), 29 GB shared memory, APS5_TEXTURE_DOWNSCALE=1.

run FPS frame p50 ms GPU busy ms/present passes / 10 s forced
A1 0.528 1461 323 840 122
B1 0.503 1695 314 902 42
A2 0.543 10170 402 448 145
B2 0.426 4660 369 180 22
  • Forced passes fall from 2584–4250 to 7–16 on NVIDIA and from 122–145 to 22–42 on the 780M.
  • FPS: A averages 0.212 and B 0.186 on NVIDIA; on the 780M, A averages 0.536 and B 0.465. The spread within each arm is about as large as that difference, so I don't read it as a regression either, just no gain.
  • Neither machine is GPU-limited in this level: GPU busy per present is 1.3–1.9 s against 4.8–6.8 s frames on the 3080 Ti, and 0.3–0.4 s against 1.5–10 s frames on the 780M. So these runs don't test the case where you expect the GPU-time saving to show.

780M memory limit on main, in both arms:

  • With APS5_HOST_IMPORT_MIB=12288 (with and without the downscale), all three runs that reached the level, of both arms, lost the device 87–111 s into it: vkQueueSubmit ... Vulkan result -4 on a DISPATCH_INDIRECT of compute shader 0x500617500, with the kernel logging amdgpu: Not enough memory for command submission!.
  • With the default import budget, B1 and A2 still hit the same kernel error 292–295 s after the level start, just before the stop. Their tables above end at 280 s.

Not checked: Windows, Intel, the frame dumps, and the agc_driver_* tests on these GPUs. The desktop also served the game data read-only to the 780M box during its runs, the same for both of its arms.

AI-assisted.

@relativespace2K

Copy link
Copy Markdown
Contributor

Windows/AMD validation on RDNA 2: the new path passes, and the switch still turns it off.

  • AMD Radeon RX 6800 XT (gfx1030, subgroup 64), AMD proprietary driver 26.10.1, Windows 11 IoT Enterprise LTSC 26100, head f17a7f35f8, Release, WinLibs GCC 15.2.
  • ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.
  • Default: agc_driver_rect_list_indirect 1.09 s and agc_driver_settled_indirect_read 1.04 s, both pass; no VUID- line, layer loaded.
  • With APS5_NO_SETTLED_INDIRECT_READ=1, rect_list_indirect still passes and settled_indirect_read fails with took the GPU-side path 4 times and read their records on the CPU as: , expected 4 settled reads, which is the control arm asserting itself, so the switch is honoured.

The PR's own run is on an RTX 4090; this adds an AMD one for the settled-record path.

@hamdanpor-ctrl

Copy link
Copy Markdown
Contributor

Test report, NVIDIA on Windows: clean.

  • GPU: NVIDIA GeForce RTX 3050 Laptop GPU, driver 617.42, Windows 11 Pro (10.0.26300)
  • Build: WinLibs GCC 15.2.0 r7 UCRT, Release, all AGC execution tests built
  • Compared: main at 7f64d6f, and the same commit with f17a7f3 merged (git merge --no-ff, clean)
  • Environment: ANYPS5_GPU=NVIDIA, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0)
  • Command: ctest --test-dir build -V --parallel 4 -R "^agc_|^request_serializer|shader"
main main + this PR
Passed 1623 1624
Failed 0 0
VUID- lines 0 0
Validation messages 61 61, same IDs
  • New agc_driver_settled_indirect_read passes.
  • Every other test has the same result on both commits; the layer loads in both logs and neither reports it missing.

Single run each. AI-assisted (Claude Code).

@JJenkx

JJenkx commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

I opened follow-up #19620 for live strided OOB_SELECT 2/3 vertex inputs whose indirect copy cannot be sized by NUM_RECORDS. It resolves records in the driver before input preparation; this PR's settled decision is later in Graphics::prepareDraw, so the two changes address different gaps.

The overlap is the appended IndirectDrawPath enum/profile label. I propose this older PR lands first; I will rebase #19620 afterward and retain both Settled and VertexFetchRange with matching labels. It is not a semantic dependency of either implementation. #19620's body records this composition requirement and includes a manual review of all overlap reports. Its focused change passes 19/19 versus 13/19 with only its new routing condition removed, zero skips/VUID; evidence is attached there. No title-unblock or FPS claim.

@github-actions github-actions Bot removed the perf numbers missing perf pull request without a before and after summary line label Nov 13, 2026
@oneandonlydean
oneandonlydean merged commit 6631e43 into boykopovar:main Nov 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants