Skip to content

perf(agc): size a draw's descriptor sets only when none is recycled - #26436

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
Meh7an:perf/agc-draw-set-inline
Nov 29, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
Meh7an:perf/agc-draw-set-inline

Conversation

@Meh7an

@Meh7an Meh7an commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

A draw that reads copies (almost every draw on Sonic Origins' S3K menu page: 99.3% of PrepareDrawBindings calls) makes its own descriptor sets in ShaderResources::writeDrawSets, one per split set. Three things in it cost every draw something that a recycled set makes unnecessary:

  • the per-type descriptor counts of both sets were rebuilt on every draw (two thread-owned vectors cleared and refilled, a find_if per binding, a sort), although they are only read when the descriptor cache has no recycled set to hand out, which after the first draws is never on this page (recycle hit 100%, miss 0 in a counting build);
  • DescriptorCache::AllocateRewritten copied the recycled SetAllocation (its sizes vector and table pointer included) out of its list where it can be moved;
  • the index that maps an allocation to its in-place view was filled for every draw, although only a draw with in-place elements reads it.

DescriptorCache::TakeRewritten moves the recycled set out of the cache (AllocateRewritten is now TakeRewritten plus Allocate), writeDrawSets builds the counts the first time a set misses, and the in-place index only when DrawBindings::inPlace is not empty. Two files in the library change (ShaderResources.hpp: one declaration; ShaderResources.cpp) plus the descriptor cache test. No switch, no new state, no behaviour change.

What it shows. writeDrawSets rotates between bodies per call in a timing build (call % 3: main's body, this change's body and a third variant), all on one thread in one run, so machine state cancels (the whole-run timings of separate builds moved by 5 to 10% with the run's FPS and could not resolve this). Two runs on the S3K page, steady windows (calls per window above 90,000 per body), ns per call:

run main's body this change's body windows
1 1334 (1286-1387) 1156 (1110-1210) 8
2 1294 (1246-1491) 1097 (1080-1138) 7

That is -178 and -197 ns per call (-13.3% and -15.2%), with the ranges disjoint in both runs: about 190 ns for each of the 36,000 draws a second the page makes, 0.7% of the committer's time, about 0.4 ms of a 62 ms frame. The frame is flat: see the sampler and traced tables below; the queue worker is blocked 17 to 19% in Enqueue and Drain and the committer is 71 to 72% in commitDraw, so the two threads are coupled and 0.4 ms of one of them does not reach the frame by itself. I am proposing it for the saving on the committer's own path, not for a measured frame-rate gain.

What a counting build showed about the rest of build A's idea (so that nobody tries it again here): the page makes 34,400 own-set draws a second, each with 3.9 bindings and 7.9 descriptors (5.4 buffers, 2.0 sampled images, 0.5 samplers), and 5.1 of the 5.4 buffer descriptors are replaced by snapshots; rebound 0, fault-record draws 0. Two ideas that I measured the same way and dropped because they gave nothing on this base: a draw-owned list of 12 inline snapshots instead of the heap vector (the whole function did not get faster; the vector comes from the per-thread block cache of #24515), and copying the template set's untouched descriptors instead of rewriting them (no faster than this change's body in the rotation, -42 and +38 ns per call: only 2.5 image and sampler descriptors per draw could be copied, and one write per replaced element adds structs).

Overlap. tools/pr_overlap.py over 2,547 open PRs failed closed (52 PRs share ShaderResources.hpp, ShaderResources.cpp or tests/Graphics.cpp, some conflicting with main themselves), so I read the patches of those 52 for writeDrawSets, AllocateRewritten, TakeRewritten, recycled, the in-place index and the count lambdas: only #7642 and #9508 (the GPU descriptor heap, conflicting) change writeDrawSets' signature and would rewrite it outright; no open PR touches AllocateRewritten or the counts. Earlier, a scan of 2,599 open PRs for the draw-set symbols (167 candidates by path, all patches read) found none that implements this: #22647 (conflicting) changes PrepareDrawBindings' parameters and reads snapshots as a span, which this change does not touch. The commit is on main bfcd717ebc5, merges cleanly onto upstream main 75981fd49b1.

Tested

Windows 11 (10.0.26300), NVIDIA GeForce RTX 2080 Ti (driver 610.88), Intel Core i9-9900K. Sonic Origins (PPSA05324) menu on the S3K page with the four add-ons, 3840x2160, default environment. Measured commits: main bfcd717ebc5 (the base) and da362924bd6, which has the same tree as this PR's head d5612492a55 (the head only has a corrected commit message, so the summaries and traces name the earlier hash).

Tests. New cases in descriptorCacheTests (agc_descriptor_cache): an empty recycle list serves nothing, a set recycled with a variable image count is not served for another count or for none, TakeRewritten returns the whole set (pool and count kept) once and not twice. The focused set around the changed code (descriptor cache and pool, draw descriptors, snapshot, recorder, draw inputs, copied write-back, fault records, resources, vertex input: 90 ctest names, 89 pass and agc_driver_pipelined_flush_read_order_draw_pipeline is skipped in both builds because their ANYPS5_AGC_EXECUTION_TESTS list leaves it out) gives the identical list of results on main and on this change, plain and with VK_LAYER_KHRONOS_validation (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_LOADER_DEBUG=layer), same machine and GPU: 0 VUID-, no "was not found but was requested" line, 474 layer lines in each log. Seven of eleven mutants are caught (a take that does not pop, ignores the variable count, serves an empty list, or is never made; no set described; a miss that allocates nothing; the in-place index never built, caught by agc_driver_dispatch_rebind, which is not in the 90); four survive: the counts never computed, never cleared, keyed to set 0, and the fragment set sized as set 0. They only change the pool sizes of a freshly allocated set, which needs a draw set larger than the chain pool (4,096 storage buffers or 1,024 sampled images) and no unit test builds one; the code is the old counting loop moved into a lambda. Not run: Linux and macOS, other GPUs, the full ctest suite.

Sampler (APS5_SAMPLE_WORKER and APS5_SAMPLE_COMMITTER, one 60 s window per arm, about 3,840 samples per thread, both orders; benchmark leases, outside CPU 13.6% on average and the lease was not quiet at its start; the change windows ran the same diff before it was committed, so their title read main bfcd717ebc5 dirty):

window arm FPS median (min-max) committer commitDraw PrepareDrawBindings writeDrawSets AllocateRewritten / TakeRewritten worker blocked in Enqueue and Drain
r1 main 16.68 (16.03-17.52) 71.35% 9.41% 3.18% 0.68% / - 19.0%
r2 change 17.16 (16.15-17.63) 71.83% 10.40% 3.86% - / 1.07% 17.3%
r3 change 16.70 (14.64-17.33) 71.40% 9.63% 2.78% - / 0.86% 18.1%
r4 main 16.89 (15.25-17.22) 72.44% 10.75% 4.37% 0.88% / - 18.4%

Means: FPS main 16.79, change 16.93 (+0.8%); commitDraw 71.9% and 71.6%; PrepareDrawBindings 10.1% and 10.0%; writeDrawSets 3.78% and 3.32%. The writeDrawSets row moves the way the rotation says, but the two windows of each arm differ by 1.2 to 1.6 points, more than the 0.5 point the saving is worth, so the sampler cannot resolve it. What is left of the cache's share is the lock and the std::map lookup under it (0.9 to 1.1% of the committer).

Traced runs (APS5_TRACE_SECONDS=200:15, same page, committed build against the base, both orders, tools/trace_digest.py):

Run Arm (commit) FPS presents p50 ms p90 ms p99 ms GPU busy ms
pt1 main (bfcd717) 15.53 227 65.6 72.5 80.3 30.6
pt1 this PR (da362924bd6a) 17.39 227 65.4 70.9 87.6 30.7
pt2 this PR (da362924bd6a) 16.99 209 70.1 82.8 134.0 31.3
pt2 main (bfcd717) 16.78 203 71.8 88.4 109.6 32.2

FPS: main 16.16, this PR 17.19 (+6.4%); pair deltas +12.0% and +1.3%; p50 68.7 and 67.8 ms; p99 95.0 and 110.8 ms; GPU busy 31.4 and 31.0 ms per present; main alone spans 15.53 to 16.78 FPS.

The PR runs are the committed tree (da362924bd6; the PR head only has a corrected commit message). I do not read this as a frame gain. The saving is about 0.4 ms of a 62 ms frame, which is about 0.1 FPS; main's first run (15.53) is the lowest main reading I have taken on this page, main alone spans 15.53 to 16.78 FPS, the outside CPU averaged 17.5% over the four runs (the lease was not quiet at its start), and the second pair's runs show p99 spikes of 110 and 134 ms in both arms. So the traced runs show no frame change that the change can be credited with, and none against it. All four traces lost events the same way (the queue worker's buffer fills after a few seconds), so slice timings cover the first seconds only.

The summaries and traces are attached as m37_trace_main_pt1_bfcd717ebc5.zip, m37_trace_main_pt2_bfcd717ebc5.zip, m37_trace_pr_pt1_da362924bd6.zip and m37_trace_pr_pt2_da362924bd6.zip, one zip per traced run, each with its digest; the instrumentation of the rotation and of the counting build (patches against bfcd717ebc5, not part of this PR) is attached as m37_instrumentation.zip.

aps5-summary.jsonl lines: main (pt1), this PR (pt1), this PR (pt2), main (pt2)
{"commit":"bfcd717ebc57","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":5610,"ms":15058.808},"presents":227,"frame_ms":{"p50":65.626,"p90":72.465,"p99":80.347,"max":82.666},"gpu_busy_ms_per_present":30.605,"worker_busy_pct":{"queue worker 0x0":96.728},"phase_totals_ms":{"Driver.Completion":3.961,"Driver.Dispatch":1377.833,"Driver.Dispatch.capture_resources":16.706,"Driver.Dispatch.decode_key_device_setup":1006.496,"Driver.Dispatch.lookup_cache":14.799,"Driver.Dispatch.materialize":3.408,"Driver.Dispatch.prepared_invocation":3.085,"Driver.Draw":10960.275,"Driver.Draw.device_setup":781.733,"Driver.Draw.draw_enqueued":2091.088,"Driver.Draw.post_compile_prepare":198.878,"Driver.Draw.prepare":1341.095,"Driver.Draw.shader_compile_and_link":6294.826,"Driver.EndSubmission":7.069,"Driver.Packet":14554.939,"Driver.Packet.device_lock":155.758,"Driver.Packet.dispatch":1382.025,"Driver.Packet.draw":11167.731,"Driver.Packet.execute":381.398,"Driver.Packet.flip_flush":6.911,"Driver.Packet.flush_between_packets":457.613,"Driver.Packet.memory_wait":0.050,"Driver.Packet.pipeline_drain":222.804,"Driver.Packet.pipeline_prepare":273.970,"Driver.Packet.prepare_memory":246.732,"Driver.Packet.rendering_wait":0.339,"Driver.Present":2614.657,"Driver.Present.acquire_image":3.027,"Driver.Present.device_setup":0.177,"Driver.Present.gpu_mutex_wait":35.392,"Driver.Present.inflight_wait":0.630,"Driver.Present.present_display_buffer":44.656,"Driver.Present.queue_present":46.691,"Driver.Present.release_and_callback":1.037,"Driver.Present.render_fence_wait":2482.268,"Driver.Present.resize":0.470,"Driver.Present.validate":0.066,"Driver.Suspend":0.070,"GpuMutex.wait.draw":76.350,"GpuMutex.wait.end":1.150,"GpuMutex.wait.fill":2.754,"GpuMutex.wait.flush":1.177,"GpuMutex.wait.label":3.644,"GpuMutex.wait.other":2.568,"GpuMutex.wait.present":34.781,"GpuMutex.wait.wait":3.707,"Graphics.Draw":9386.121,"Graphics.Draw.draw_and_resource_release":7172.901,"Graphics.Draw.index_upload":470.452,"Graphics.Draw.validate":858.524,"Graphics.Draw.vertex_upload":734.137,"Graphics.DrawWithRecipe":631.316,"Graphics.DrawWithRecipe.draw_and_resource_release":603.491,"Graphics.DrawWithRecipe.index_upload":4.107,"Graphics.DrawWithRecipe.validate":9.653,"Graphics.DrawWithRecipe.vertex_upload":8.491,"Recorder.Reap":147.341,"Recorder.Submit":463.885,"Recorder.WaitSerial":2583.186,"Resources.Complete":99.518,"Resources.Prepare":53.160,"Shader.DrawStage":4079.420,"Shader.DrawStage.capture_resources":1816.590,"Shader.DrawStage.materialize":1189.124,"Shader.DrawStage.prepared_invocation":991.446,"Shader.ResolveAbi":157.704,"Shader.ResolveGraphicsAbi":61.452,"Shader.ResolveGraphicsStagesAbi":158.418,"VideoOut.Flip":2618.935,"VideoOut.Flip.completion_mutex_wait":0.411,"VideoOut.Flip.config_mutex_wait":0.030,"VideoOut.Flip.frame_limit":0.202,"VideoOut.Flip.notify_game":9.192,"VideoOut.Flip.present":2605.149,"VideoOut.Flip.validate":0.365,"VideoOut.Flip.vblank_wait":0.212,"VideoOut.Flip.window_prepare":0.395,"VideoOut.Flip.window_title":2.631,"VideoOut.Readiness":0.945,"VideoOut.Readiness.locks_validate":0.454,"Vulkan.Acquire":2.761,"Vulkan.Acquire.acquire_fence_wait":0.520,"Vulkan.Acquire.acquire_image":1.513,"Vulkan.Acquire.fence_reset":0.515,"Vulkan.Acquire.retired_swapchains":0.120,"Vulkan.Dispatch":181.437,"Vulkan.Dispatch.command_record":59.679,"Vulkan.Dispatch.shader_resources":120.566,"Vulkan.DrawFromRecipe":640.148,"Vulkan.Present":24.007,"Vulkan.Present.command_record_scale":8.991,"Vulkan.Present.pixel_upload":1.551,"Vulkan.Present.queue_submit":13.144,"Vulkan.QueuePresent":45.685,"Vulkan.QueuePresent.queue_present":45.275,"Vulkan.Retire":2482.039,"Vulkan.Retire.wait":2476.035},"top_phases_ms_per_frame":{"Driver.Packet":64.119,"Driver.Packet.draw":49.197,"Driver.Draw":48.283,"Graphics.Draw":41.349,"Graphics.Draw.draw_and_resource_release":31.599,"Driver.Draw.shader_compile_and_link":27.731,"Shader.DrawStage":17.971,"VideoOut.Flip":11.537},"owned_draw_counts":{"OwnedDraw.evicted_other":1200},"graphics_track":{"Graphics.Barrier.copy":908,"Graphics.Barrier.dispatch-lead":1383,"Graphics.Barrier.dispatch-trail":2497,"Graphics.Barrier.draw":37139,"Graphics.Barrier.fill-clear":2270,"Graphics.Barrier.label-run":39038,"Graphics.Barrier.present-blit":454,"Graphics.Barrier.staging-in":2110,"Graphics.Barrier.staging-out":454,"Graphics.Barrier.storage-upload":25878,"Graphics.Barrier.storage-writeback":2302,"Graphics.BarrierMerged.dispatch-lead":1114,"Graphics.BarrierMerged.staging-in":160,"Graphics.BarrierMerged.staging-out":454,"Graphics.BarrierMerged.storage-writeback":422,"Graphics.Copy":1362,"Graphics.Copy.bytes":14557056,"Graphics.RenderPass":18332,"Graphics.RenderPass.Close.command":6750,"Graphics.RenderPass.Close.image":17,"Graphics.RenderPass.Close.key":866,"Graphics.RenderPass.Close.new-batch":10699,"Graphics.RenderPass.Continued":461655},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.916,"events_lost":533246,"totals_full":false},"draw committer":{"events_full_after_s":13.893,"events_lost":24603,"totals_full":false}},"trace":"aps5-trace-bfcd717ebc57-31220.json.gz"}
{"commit":"da362924bd6a","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4425,"ms":15015.957},"presents":227,"frame_ms":{"p50":65.409,"p90":70.912,"p99":87.564,"max":107.348},"gpu_busy_ms_per_present":30.725,"worker_busy_pct":{"queue worker 0x0":96.723},"phase_totals_ms":{"Driver.Completion":3.454,"Driver.Dispatch":1388.995,"Driver.Dispatch.capture_resources":15.601,"Driver.Dispatch.decode_key_device_setup":1014.785,"Driver.Dispatch.lookup_cache":14.972,"Driver.Dispatch.materialize":2.954,"Driver.Dispatch.prepared_invocation":2.820,"Driver.Draw":10868.334,"Driver.Draw.device_setup":790.678,"Driver.Draw.draw_enqueued":2028.368,"Driver.Draw.post_compile_prepare":203.906,"Driver.Draw.prepare":1339.581,"Driver.Draw.shader_compile_and_link":6252.842,"Driver.EndSubmission":13.808,"Driver.Packet":14506.607,"Driver.Packet.device_lock":159.196,"Driver.Packet.dispatch":1392.874,"Driver.Packet.draw":11069.700,"Driver.Packet.execute":391.496,"Driver.Packet.flip_flush":7.709,"Driver.Packet.flush_between_packets":460.975,"Driver.Packet.memory_wait":0.029,"Driver.Packet.pipeline_drain":233.910,"Driver.Packet.pipeline_prepare":273.712,"Driver.Packet.prepare_memory":245.672,"Driver.Packet.rendering_wait":0.505,"Driver.Present":2662.344,"Driver.Present.acquire_image":2.883,"Driver.Present.device_setup":0.156,"Driver.Present.gpu_mutex_wait":20.944,"Driver.Present.inflight_wait":0.598,"Driver.Present.present_display_buffer":38.354,"Driver.Present.queue_present":43.340,"Driver.Present.release_and_callback":1.164,"Driver.Present.render_fence_wait":2554.178,"Driver.Present.resize":0.424,"Driver.Present.validate":0.068,"Driver.Suspend":0.073,"GpuMutex.wait.dispatch":0.021,"GpuMutex.wait.draw":68.839,"GpuMutex.wait.end":0.862,"GpuMutex.wait.fill":0.319,"GpuMutex.wait.flush":0.295,"GpuMutex.wait.label":1.529,"GpuMutex.wait.other":0.963,"GpuMutex.wait.present":20.376,"GpuMutex.wait.wait":4.254,"Graphics.Draw":9157.115,"Graphics.Draw.draw_and_resource_release":7036.098,"Graphics.Draw.index_upload":452.641,"Graphics.Draw.validate":822.511,"Graphics.Draw.vertex_upload":703.748,"Graphics.DrawWithRecipe":720.456,"Graphics.DrawWithRecipe.draw_and_resource_release":674.231,"Graphics.DrawWithRecipe.index_upload":8.742,"Graphics.DrawWithRecipe.validate":14.560,"Graphics.DrawWithRecipe.vertex_upload":15.536,"Recorder.Reap":138.873,"Recorder.Submit":522.570,"Recorder.WaitSerial":2632.212,"Resources.Complete":75.960,"Resources.Prepare":53.456,"Shader.DrawStage":4039.982,"Shader.DrawStage.capture_resources":1829.347,"Shader.DrawStage.materialize":1138.715,"Shader.DrawStage.prepared_invocation":984.256,"Shader.ResolveAbi":161.050,"Shader.ResolveGraphicsAbi":60.452,"Shader.ResolveGraphicsStagesAbi":158.124,"VideoOut.Flip":2663.650,"VideoOut.Flip.completion_mutex_wait":0.418,"VideoOut.Flip.config_mutex_wait":0.031,"VideoOut.Flip.frame_limit":0.193,"VideoOut.Flip.notify_game":8.309,"VideoOut.Flip.present":2651.014,"VideoOut.Flip.validate":0.309,"VideoOut.Flip.vblank_wait":0.203,"VideoOut.Flip.window_prepare":0.391,"VideoOut.Flip.window_title":2.471,"VideoOut.Readiness":0.814,"VideoOut.Readiness.locks_validate":0.346,"Vulkan.Acquire":2.618,"Vulkan.Acquire.acquire_fence_wait":0.454,"Vulkan.Acquire.acquire_image":1.469,"Vulkan.Acquire.fence_reset":0.498,"Vulkan.Acquire.retired_swapchains":0.114,"Vulkan.Dispatch":183.046,"Vulkan.Dispatch.command_record":60.304,"Vulkan.Dispatch.shader_resources":121.575,"Vulkan.DispatchRecipe":1.001,"Vulkan.DispatchRecipe.command_record":1.000,"Vulkan.DrawFromRecipe":732.406,"Vulkan.Present":20.017,"Vulkan.Present.command_record_scale":8.259,"Vulkan.Present.pixel_upload":0.834,"Vulkan.Present.queue_submit":10.653,"Vulkan.QueuePresent":42.594,"Vulkan.QueuePresent.queue_present":42.223,"Vulkan.Retire":2553.945,"Vulkan.Retire.wait":2549.029},"top_phases_ms_per_frame":{"Driver.Packet":63.906,"Driver.Packet.draw":48.765,"Driver.Draw":47.878,"Graphics.Draw":40.340,"Graphics.Draw.draw_and_resource_release":30.996,"Driver.Draw.shader_compile_and_link":27.546,"Shader.DrawStage":17.797,"VideoOut.Flip":11.734},"owned_draw_counts":{"OwnedDraw.evicted_other":1073},"graphics_track":{"Graphics.Barrier.copy":908,"Graphics.Barrier.dispatch-lead":1381,"Graphics.Barrier.dispatch-trail":2500,"Graphics.Barrier.draw":37200,"Graphics.Barrier.fill-clear":2270,"Graphics.Barrier.label-run":39077,"Graphics.Barrier.present-blit":454,"Graphics.Barrier.shadow-publish":2,"Graphics.Barrier.staging-in":2110,"Graphics.Barrier.staging-out":454,"Graphics.Barrier.storage-upload":25888,"Graphics.Barrier.storage-writeback":2319,"Graphics.BarrierMerged.dispatch-lead":1119,"Graphics.BarrierMerged.label-run":11,"Graphics.BarrierMerged.shadow-publish":2,"Graphics.BarrierMerged.staging-in":164,"Graphics.BarrierMerged.staging-out":454,"Graphics.BarrierMerged.storage-writeback":418,"Graphics.Copy":1364,"Graphics.Copy.bytes":14557152,"Graphics.RenderPass":18367,"Graphics.RenderPass.Close.command":6740,"Graphics.RenderPass.Close.image":16,"Graphics.RenderPass.Close.key":892,"Graphics.RenderPass.Close.label":11,"Graphics.RenderPass.Close.new-batch":10708,"Graphics.RenderPass.Continued":461181},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.915,"events_lost":516113,"totals_full":false},"draw committer":{"events_full_after_s":13.764,"events_lost":22165,"totals_full":false}},"trace":"aps5-trace-da362924bd6a-24316.json.gz"}
{"commit":"da362924bd6a","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4434,"ms":15068.953},"presents":209,"frame_ms":{"p50":70.131,"p90":82.818,"p99":134.029,"max":168.317},"gpu_busy_ms_per_present":31.337,"worker_busy_pct":{"queue worker 0x0":96.810},"phase_totals_ms":{"Driver.Completion":3.583,"Driver.Dispatch":1436.500,"Driver.Dispatch.capture_resources":16.537,"Driver.Dispatch.decode_key_device_setup":1072.720,"Driver.Dispatch.lookup_cache":15.082,"Driver.Dispatch.materialize":3.356,"Driver.Dispatch.prepared_invocation":3.166,"Driver.Draw":10843.337,"Driver.Draw.device_setup":750.562,"Driver.Draw.draw_enqueued":2139.936,"Driver.Draw.post_compile_prepare":196.651,"Driver.Draw.prepare":1321.326,"Driver.Draw.shader_compile_and_link":6189.806,"Driver.EndSubmission":12.411,"Driver.Packet":14572.102,"Driver.Packet.device_lock":147.063,"Driver.Packet.dispatch":1440.756,"Driver.Packet.draw":11046.717,"Driver.Packet.execute":379.384,"Driver.Packet.flip_flush":6.592,"Driver.Packet.flush_between_packets":439.579,"Driver.Packet.memory_wait":0.077,"Driver.Packet.pipeline_drain":240.193,"Driver.Packet.pipeline_prepare":261.935,"Driver.Packet.prepare_memory":237.918,"Driver.Packet.rendering_wait":0.341,"Driver.Present":2394.298,"Driver.Present.acquire_image":2.875,"Driver.Present.device_setup":0.183,"Driver.Present.gpu_mutex_wait":9.156,"Driver.Present.inflight_wait":0.583,"Driver.Present.present_display_buffer":39.853,"Driver.Present.queue_present":43.939,"Driver.Present.release_and_callback":0.801,"Driver.Present.render_fence_wait":2296.229,"Driver.Present.resize":0.423,"Driver.Present.validate":0.072,"Driver.Suspend":0.089,"GpuMutex.wait.draw":87.121,"GpuMutex.wait.end":0.162,"GpuMutex.wait.fill":1.187,"GpuMutex.wait.flush":0.352,"GpuMutex.wait.label":1.131,"GpuMutex.wait.other":1.021,"GpuMutex.wait.present":8.604,"GpuMutex.wait.wait":2.861,"Graphics.Draw":9235.731,"Graphics.Draw.draw_and_resource_release":7120.194,"Graphics.Draw.index_upload":440.586,"Graphics.Draw.validate":834.445,"Graphics.Draw.vertex_upload":702.208,"Graphics.DrawWithRecipe":644.918,"Graphics.DrawWithRecipe.draw_and_resource_release":616.393,"Graphics.DrawWithRecipe.index_upload":4.248,"Graphics.DrawWithRecipe.validate":9.733,"Graphics.DrawWithRecipe.vertex_upload":9.110,"Recorder.Reap":149.146,"Recorder.Submit":471.642,"Recorder.WaitSerial":2365.613,"Resources.Complete":111.748,"Resources.Prepare":52.648,"Shader.DrawStage":4011.481,"Shader.DrawStage.capture_resources":1817.916,"Shader.DrawStage.materialize":1137.843,"Shader.DrawStage.prepared_invocation":971.527,"Shader.ResolveAbi":161.212,"Shader.ResolveGraphicsAbi":62.502,"Shader.ResolveGraphicsStagesAbi":159.273,"VideoOut.Flip":2413.995,"VideoOut.Flip.completion_mutex_wait":0.620,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.165,"VideoOut.Flip.notify_game":24.104,"VideoOut.Flip.present":2384.932,"VideoOut.Flip.validate":0.313,"VideoOut.Flip.vblank_wait":0.177,"VideoOut.Flip.window_prepare":0.421,"VideoOut.Flip.window_title":2.769,"VideoOut.Readiness":0.788,"VideoOut.Readiness.locks_validate":0.281,"Vulkan.Acquire":2.610,"Vulkan.Acquire.acquire_fence_wait":0.472,"Vulkan.Acquire.acquire_image":1.409,"Vulkan.Acquire.fence_reset":0.516,"Vulkan.Acquire.retired_swapchains":0.123,"Vulkan.Dispatch":176.806,"Vulkan.Dispatch.command_record":58.181,"Vulkan.Dispatch.shader_resources":117.412,"Vulkan.DispatchRecipe":0.806,"Vulkan.DispatchRecipe.command_record":0.805,"Vulkan.DrawFromRecipe":653.543,"Vulkan.Present":20.454,"Vulkan.Present.command_record_scale":8.774,"Vulkan.Present.pixel_upload":0.872,"Vulkan.Present.queue_submit":10.489,"Vulkan.QueuePresent":43.124,"Vulkan.QueuePresent.queue_present":42.713,"Vulkan.Retire":2296.037,"Vulkan.Retire.wait":2290.692},"top_phases_ms_per_frame":{"Driver.Packet":69.723,"Driver.Packet.draw":52.855,"Driver.Draw":51.882,"Graphics.Draw":44.190,"Graphics.Draw.draw_and_resource_release":34.068,"Driver.Draw.shader_compile_and_link":29.616,"Shader.DrawStage":19.194,"VideoOut.Flip":11.550},"owned_draw_counts":{"OwnedDraw.evicted_other":994},"graphics_track":{"Graphics.Barrier.copy":836,"Graphics.Barrier.dispatch-lead":1256,"Graphics.Barrier.dispatch-trail":2299,"Graphics.Barrier.draw":34231,"Graphics.Barrier.fill-clear":2090,"Graphics.Barrier.label-run":36119,"Graphics.Barrier.present-blit":418,"Graphics.Barrier.staging-in":1962,"Graphics.Barrier.staging-out":418,"Graphics.Barrier.storage-upload":23826,"Graphics.Barrier.storage-writeback":2113,"Graphics.BarrierMerged.dispatch-lead":1043,"Graphics.BarrierMerged.staging-in":128,"Graphics.BarrierMerged.staging-out":418,"Graphics.BarrierMerged.storage-writeback":395,"Graphics.Copy":1254,"Graphics.Copy.bytes":13402752,"Graphics.RenderPass":16887,"Graphics.RenderPass.Close.command":6072,"Graphics.RenderPass.Close.image":24,"Graphics.RenderPass.Close.key":786,"Graphics.RenderPass.Close.new-batch":10005,"Graphics.RenderPass.Continued":423522},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.708,"events_lost":582955,"totals_full":false},"draw committer":{"events_full_after_s":14.634,"events_lost":8134,"totals_full":false}},"trace":"aps5-trace-da362924bd6a-34992.json.gz"}
{"commit":"bfcd717ebc57","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4327,"ms":15047.056},"presents":203,"frame_ms":{"p50":71.802,"p90":88.374,"p99":109.581,"max":119.769},"gpu_busy_ms_per_present":32.221,"worker_busy_pct":{"queue worker 0x0":96.791},"phase_totals_ms":{"Driver.Completion":3.200,"Driver.Dispatch":1505.315,"Driver.Dispatch.capture_resources":18.213,"Driver.Dispatch.decode_key_device_setup":1133.055,"Driver.Dispatch.lookup_cache":15.553,"Driver.Dispatch.materialize":3.730,"Driver.Dispatch.prepared_invocation":3.508,"Driver.Draw":10862.925,"Driver.Draw.device_setup":755.216,"Driver.Draw.draw_enqueued":2141.478,"Driver.Draw.post_compile_prepare":196.793,"Driver.Draw.prepare":1325.181,"Driver.Draw.shader_compile_and_link":6191.768,"Driver.EndSubmission":7.426,"Driver.Packet":14553.440,"Driver.Packet.device_lock":144.626,"Driver.Packet.dispatch":1509.970,"Driver.Packet.draw":11067.935,"Driver.Packet.execute":371.995,"Driver.Packet.flip_flush":7.456,"Driver.Packet.flush_between_packets":447.740,"Driver.Packet.memory_wait":0.113,"Driver.Packet.pipeline_drain":225.693,"Driver.Packet.pipeline_prepare":261.075,"Driver.Packet.prepare_memory":240.125,"Driver.Packet.rendering_wait":0.500,"Driver.Present":2369.605,"Driver.Present.acquire_image":2.738,"Driver.Present.device_setup":0.171,"Driver.Present.gpu_mutex_wait":7.803,"Driver.Present.inflight_wait":0.631,"Driver.Present.present_display_buffer":39.623,"Driver.Present.queue_present":43.215,"Driver.Present.release_and_callback":0.775,"Driver.Present.render_fence_wait":2273.964,"Driver.Present.resize":0.432,"Driver.Present.validate":0.070,"Driver.Suspend":0.067,"GpuMutex.wait.draw":83.165,"GpuMutex.wait.end":0.686,"GpuMutex.wait.fill":1.125,"GpuMutex.wait.flush":1.132,"GpuMutex.wait.label":0.277,"GpuMutex.wait.other":0.771,"GpuMutex.wait.present":7.289,"GpuMutex.wait.wait":10.099,"Graphics.Draw":9322.634,"Graphics.Draw.draw_and_resource_release":7159.976,"Graphics.Draw.index_upload":460.740,"Graphics.Draw.validate":843.371,"Graphics.Draw.vertex_upload":707.553,"Graphics.DrawWithRecipe":623.071,"Graphics.DrawWithRecipe.draw_and_resource_release":587.035,"Graphics.DrawWithRecipe.index_upload":5.132,"Graphics.DrawWithRecipe.validate":10.449,"Graphics.DrawWithRecipe.vertex_upload":10.201,"Recorder.Reap":156.819,"Recorder.Submit":533.344,"Recorder.WaitSerial":2340.175,"Resources.Complete":144.765,"Resources.Prepare":69.225,"Shader.DrawStage":4019.991,"Shader.DrawStage.capture_resources":1804.612,"Shader.DrawStage.materialize":1156.995,"Shader.DrawStage.prepared_invocation":977.543,"Shader.ResolveAbi":169.709,"Shader.ResolveGraphicsAbi":61.834,"Shader.ResolveGraphicsStagesAbi":164.608,"VideoOut.Flip":2370.044,"VideoOut.Flip.completion_mutex_wait":0.405,"VideoOut.Flip.config_mutex_wait":0.048,"VideoOut.Flip.frame_limit":0.160,"VideoOut.Flip.notify_game":8.782,"VideoOut.Flip.present":2357.714,"VideoOut.Flip.validate":0.304,"VideoOut.Flip.vblank_wait":0.183,"VideoOut.Flip.window_prepare":0.415,"VideoOut.Flip.window_title":1.694,"VideoOut.Readiness":0.765,"VideoOut.Readiness.locks_validate":0.290,"Vulkan.Acquire":2.482,"Vulkan.Acquire.acquire_fence_wait":0.457,"Vulkan.Acquire.acquire_image":1.351,"Vulkan.Acquire.fence_reset":0.480,"Vulkan.Acquire.retired_swapchains":0.115,"Vulkan.Dispatch":183.471,"Vulkan.Dispatch.command_record":60.913,"Vulkan.Dispatch.shader_resources":121.293,"Vulkan.DispatchRecipe":1.036,"Vulkan.DispatchRecipe.command_record":1.034,"Vulkan.DrawFromRecipe":632.359,"Vulkan.Present":20.825,"Vulkan.Present.command_record_scale":8.922,"Vulkan.Present.pixel_upload":0.746,"Vulkan.Present.queue_submit":10.848,"Vulkan.QueuePresent":42.381,"Vulkan.QueuePresent.queue_present":41.964,"Vulkan.Retire":2273.812,"Vulkan.Retire.wait":2268.820},"top_phases_ms_per_frame":{"Driver.Packet":71.692,"Driver.Packet.draw":54.522,"Driver.Draw":53.512,"Graphics.Draw":45.924,"Graphics.Draw.draw_and_resource_release":35.271,"Driver.Draw.shader_compile_and_link":30.501,"Shader.DrawStage":19.803,"VideoOut.Flip":11.675},"owned_draw_counts":{"OwnedDraw.evicted_other":999},"graphics_track":{"Graphics.Barrier.copy":812,"Graphics.Barrier.dispatch-lead":1222,"Graphics.Barrier.dispatch-trail":2236,"Graphics.Barrier.draw":33237,"Graphics.Barrier.fill-clear":2030,"Graphics.Barrier.label-run":35117,"Graphics.Barrier.present-blit":406,"Graphics.Barrier.shadow-publish":2,"Graphics.Barrier.staging-in":1913,"Graphics.Barrier.staging-out":406,"Graphics.Barrier.storage-upload":23152,"Graphics.Barrier.storage-writeback":2056,"Graphics.BarrierMerged.dispatch-lead":1014,"Graphics.BarrierMerged.shadow-publish":2,"Graphics.BarrierMerged.staging-in":121,"Graphics.BarrierMerged.staging-out":406,"Graphics.BarrierMerged.storage-writeback":393,"Graphics.Copy":1220,"Graphics.Copy.bytes":13018080,"Graphics.RenderPass":16391,"Graphics.RenderPass.Close.command":5884,"Graphics.RenderPass.Close.image":25,"Graphics.RenderPass.Close.key":773,"Graphics.RenderPass.Close.new-batch":9709,"Graphics.RenderPass.Continued":412508},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.601,"events_lost":586883,"totals_full":false},"draw committer":{"events_full_after_s":13.288,"events_lost":33156,"totals_full":false}},"trace":"aps5-trace-bfcd717ebc57-38016.json.gz"}
Digest: main, run pt1 (commit bfcd717)

seconds 200:15 from present 5610: 227 presents, frame p50 65.6 / p90 72.5 / p99 80.3 / max 82.7 ms, GPU busy 30.6 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 610.88, Windows 10.0.26300, 3840x2160, commit bfcd717, dropped: yes

{"commit":"bfcd717ebc57","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":5610,"ms":15058.808},"presents":227,"frame_ms":{"p50":65.626,"p90":72.465,"p99":80.347,"max":82.666},"gpu_busy_ms_per_present":30.605,"worker_busy_pct":{"queue worker 0x0":96.728},"phase_totals_ms":{"Driver.Completion":3.961,"Driver.Dispatch":1377.833,"Driver.Dispatch.capture_resources":16.706,"Driver.Dispatch.decode_key_device_setup":1006.496,"Driver.Dispatch.lookup_cache":14.799,"Driver.Dispatch.materialize":3.408,"Driver.Dispatch.prepared_invocation":3.085,"Driver.Draw":10960.275,"Driver.Draw.device_setup":781.733,"Driver.Draw.draw_enqueued":2091.088,"Driver.Draw.post_compile_prepare":198.878,"Driver.Draw.prepare":1341.095,"Driver.Draw.shader_compile_and_link":6294.826,"Driver.EndSubmission":7.069,"Driver.Packet":14554.939,"Driver.Packet.device_lock":155.758,"Driver.Packet.dispatch":1382.025,"Driver.Packet.draw":11167.731,"Driver.Packet.execute":381.398,"Driver.Packet.flip_flush":6.911,"Driver.Packet.flush_between_packets":457.613,"Driver.Packet.memory_wait":0.05,"Driver.Packet.pipeline_drain":222.804,"Driver.Packet.pipeline_prepare":273.97,"Driver.Packet.prepare_memory":246.732,"Driver.Packet.rendering_wait":0.339,"Driver.Present":2614.657,"Driver.Present.acquire_image":3.027,"Driver.Present.device_setup":0.177,"Driver.Present.gpu_mutex_wait":35.392,"Driver.Present.inflight_wait":0.63,"Driver.Present.present_display_buffer":44.656,"Driver.Present.queue_present":46.691,"Driver.Present.release_and_callback":1.037,"Driver.Present.render_fence_wait":2482.268,"Driver.Present.resize":0.47,"Driver.Present.validate":0.066,"Driver.Suspend":0.07,"GpuMutex.wait.draw":76.35,"GpuMutex.wait.end":1.15,"GpuMutex.wait.fill":2.754,"GpuMutex.wait.flush":1.177,"GpuMutex.wait.label":3.644,"GpuMutex.wait.other":2.568,"GpuMutex.wait.present":34.781,"GpuMutex.wait.wait":3.707,"Graphics.Draw":9386.121,"Graphics.Draw.draw_and_resource_release":7172.901,"Graphics.Draw.index_upload":470.452,"Graphics.Draw.validate":858.524,"Graphics.Draw.vertex_upload":734.137,"Graphics.DrawWithRecipe":631.316,"Graphics.DrawWithRecipe.draw_and_resource_release":603.491,"Graphics.DrawWithRecipe.index_upload":4.107,"Graphics.DrawWithRecipe.validate":9.653,"Graphics.DrawWithRecipe.vertex_upload":8.491,"Recorder.Reap":147.341,"Recorder.Submit":463.885,"Recorder.WaitSerial":2583.186,"Resources.Complete":99.518,"Resources.Prepare":53.16,"Shader.DrawStage":4079.42,"Shader.DrawStage.capture_resources":1816.59,"Shader.DrawStage.materialize":1189.124,"Shader.DrawStage.prepared_invocation":991.446,"Shader.ResolveAbi":157.704,"Shader.ResolveGraphicsAbi":61.452,"Shader.ResolveGraphicsStagesAbi":158.418,"VideoOut.Flip":2618.935,"VideoOut.Flip.completion_mutex_wait":0.411,"VideoOut.Flip.config_mutex_wait":0.03,"VideoOut.Flip.frame_limit":0.202,"VideoOut.Flip.notify_game":9.192,"VideoOut.Flip.present":2605.149,"VideoOut.Flip.validate":0.365,"VideoOut.Flip.vblank_wait":0.212,"VideoOut.Flip.window_prepare":0.395,"VideoOut.Flip.window_title":2.631,"VideoOut.Readiness":0.945,"VideoOut.Readiness.locks_validate":0.454,"Vulkan.Acquire":2.761,"Vulkan.Acquire.acquire_fence_wait":0.52,"Vulkan.Acquire.acquire_image":1.513,"Vulkan.Acquire.fence_reset":0.515,"Vulkan.Acquire.retired_swapchains":0.12,"Vulkan.Dispatch":181.437,"Vulkan.Dispatch.command_record":59.679,"Vulkan.Dispatch.shader_resources":120.566,"Vulkan.DrawFromRecipe":640.148,"Vulkan.Present":24.007,"Vulkan.Present.command_record_scale":8.991,"Vulkan.Present.pixel_upload":1.551,"Vulkan.Present.queue_submit":13.144,"Vulkan.QueuePresent":45.685,"Vulkan.QueuePresent.queue_present":45.275,"Vulkan.Retire":2482.039,"Vulkan.Retire.wait":2476.035},"top_phases_ms_per_frame":{"Driver.Packet":64.119,"Driver.Packet.draw":49.197,"Driver.Draw":48.283,"Graphics.Draw":41.349,"Graphics.Draw.draw_and_resource_release":31.599,"Driver.Draw.shader_compile_and_link":27.731,"Shader.DrawStage":17.971,"VideoOut.Flip":11.537},"owned_draw_counts":{"OwnedDraw.evicted_other":1200},"graphics_track":{"Graphics.Barrier.copy":908,"Graphics.Barrier.dispatch-lead":1383,"Graphics.Barrier.dispatch-trail":2497,"Graphics.Barrier.draw":37139,"Graphics.Barrier.fill-clear":2270,"Graphics.Barrier.label-run":39038,"Graphics.Barrier.present-blit":454,"Graphics.Barrier.staging-in":2110,"Graphics.Barrier.staging-out":454,"Graphics.Barrier.storage-upload":25878,"Graphics.Barrier.storage-writeback":2302,"Graphics.BarrierMerged.dispatch-lead":1114,"Graphics.BarrierMerged.staging-in":160,"Graphics.BarrierMerged.staging-out":454,"Graphics.BarrierMerged.storage-writeback":422,"Graphics.Copy":1362,"Graphics.Copy.bytes":14557056,"Graphics.RenderPass":18332,"Graphics.RenderPass.Close.command":6750,"Graphics.RenderPass.Close.image":17,"Graphics.RenderPass.Close.key":866,"Graphics.RenderPass.Close.new-batch":10699,"Graphics.RenderPass.Continued":461655},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.916,"events_lost":533246,"totals_full":false},"draw committer":{"events_full_after_s":13.893,"events_lost":24603,"totals_full":false}},"trace":"aps5-trace-bfcd717ebc57-31220.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 533246 events lost; buffer full at 4915.9 ms; over the 74 of 227 frames that ended before it: busy 39.8 ms per frame (60 %), wait 0.0, largest Driver.Packet 39.7, Driver.Completion 0.0 (the thread table divides the retained slices by every frame)
  • draw committer: 24603 events lost; buffer full at 13893.2 ms; over the 209 of 227 frames that ended before it: busy 29.6 ms per frame (45 %), wait 0.4, largest Graphics.Draw 25.2, Vulkan.DrawFromRecipe 2.6 (the thread table divides the retained slices by every frame)

Slowest frames (largest slices inside each, inclusive)

  • present 5669: 82.7 ms at 3842 ms: Driver.Packet (queue worker 0x0) 64.0, Driver.Packet.draw (queue worker 0x0) 54.4, Driver.Draw (queue worker 0x0) 53.1, batch (gpu) 33.3
  • present 5697: 81.4 ms at 5747 ms: batch (gpu) 39.6, Graphics.Draw (draw committer) 35.4, Graphics.Draw.draw_and_resource_release (draw committer) 20.5, VideoOut.Flip (presenter) 12.1
  • present 5680: 80.3 ms at 4608 ms: Driver.Packet (queue worker 0x0) 61.1, Driver.Packet.draw (queue worker 0x0) 51.3, Driver.Draw (queue worker 0x0) 49.4, Graphics.Draw (draw committer) 48.2
  • present 5721: 80.2 ms at 7355 ms: batch (gpu) 35.1, Graphics.Draw (draw committer) 33.9, Graphics.Draw.draw_and_resource_release (draw committer) 20.5, VideoOut.Flip (presenter) 14.5
  • present 5703: 79.7 ms at 6167 ms: batch (gpu) 41.3, Graphics.Draw (draw committer) 29.6, Graphics.Draw.draw_and_resource_release (draw committer) 16.0, VideoOut.Flip (presenter) 12.7

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5669: 82.7 ms at 3842 ms, persistence 24.0 ms
  • present 5697: 81.4 ms at 5747 ms, persistence 20.8 ms
  • present 5721: 80.2 ms at 7355 ms, persistence 20.8 ms
  • present 5703: 79.7 ms at 6167 ms, persistence 19.9 ms
  • present 5680: 80.3 ms at 4608 ms, persistence 19.6 ms
  • present 5619: 74.7 ms at 588 ms, persistence 16.1 ms
  • present 5644: 75.6 ms at 2221 ms, persistence 15.8 ms
  • present 5730: 75.3 ms at 7988 ms, persistence 15.0 ms
  • present 5635: 75.0 ms at 1622 ms, persistence 14.3 ms
  • present 5802: 73.3 ms at 12740 ms, persistence 14.1 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 11.4 (17 %) 54.9 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 13.0 (20 %) 0.0 (0 %) 53.3 45.0 Driver.Packet 13.0, Driver.Completion 0.0
draw committer 27.4 (41 %) 0.4 (1 %) 38.6 42.9 Graphics.Draw 23.3, Vulkan.DrawFromRecipe 2.4
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
presenter 0.5 (1 %) 11.1 (17 %) 54.8 0.1 VideoOut.Flip 11.5, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.3 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 30.5 (46 %) 0.0 (0 %) 35.9 0.0 batch 30.5

Largest slices (ms per frame, inclusive, all threads): batch 30.5, Graphics.Draw 23.3, Driver.Packet 13.0, VideoOut.Flip 11.5, Driver.Present 11.5, VideoOut.Flip.present 11.5, Recorder.WaitSerial 11.4, Driver.Present.render_fence_wait 10.9, Vulkan.Retire 10.9, Vulkan.Retire.wait 10.9

Longest waits

  • Recorder.WaitSerial (title) 15.3 ms at 7506 ms, present 5722
  • Driver.Present.render_fence_wait (presenter) 14.8 ms at 7507 ms, present 5723
  • Recorder.WaitSerial (title) 14.3 ms at 7355 ms, present 5720
  • Recorder.WaitSerial (title) 14.2 ms at 723 ms, present 5621
  • Recorder.WaitSerial (title) 14.2 ms at 11867 ms, present 5788
  • Driver.Present.render_fence_wait (presenter) 14.0 ms at 724 ms, present 5621
  • Recorder.WaitSerial (title) 13.8 ms at 3192 ms, present 5658
  • Driver.Present.render_fence_wait (presenter) 13.8 ms at 11867 ms, present 5789
  • Recorder.WaitSerial (title) 13.8 ms at 10706 ms, present 5771
  • Recorder.WaitSerial (title) 13.7 ms at 196 ms, present 5613

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 10376: 5.8 ms at 10177 ms, present 5762: GPU no ranges; recorded by no CPU slices
  • batch 3478: 5.8 ms at 3375 ms, present 5661: GPU no ranges; recorded by no CPU slices
  • batch 850: 5.7 ms at 841 ms, present 5622: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1
  • batch 10241: 5.7 ms at 10042 ms, present 5760: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1
  • batch 5593: 5.6 ms at 5475 ms, present 5692: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1
Digest: this PR, run pt1 (commit da362924bd6)

seconds 200:15 from present 4425: 227 presents, frame p50 65.4 / p90 70.9 / p99 87.6 / max 107.3 ms, GPU busy 30.7 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 610.88, Windows 10.0.26300, 3840x2160, commit da362924bd6a, dropped: yes

{"commit":"da362924bd6a","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4425,"ms":15015.957},"presents":227,"frame_ms":{"p50":65.409,"p90":70.912,"p99":87.564,"max":107.348},"gpu_busy_ms_per_present":30.725,"worker_busy_pct":{"queue worker 0x0":96.723},"phase_totals_ms":{"Driver.Completion":3.454,"Driver.Dispatch":1388.995,"Driver.Dispatch.capture_resources":15.601,"Driver.Dispatch.decode_key_device_setup":1014.785,"Driver.Dispatch.lookup_cache":14.972,"Driver.Dispatch.materialize":2.954,"Driver.Dispatch.prepared_invocation":2.82,"Driver.Draw":10868.334,"Driver.Draw.device_setup":790.678,"Driver.Draw.draw_enqueued":2028.368,"Driver.Draw.post_compile_prepare":203.906,"Driver.Draw.prepare":1339.581,"Driver.Draw.shader_compile_and_link":6252.842,"Driver.EndSubmission":13.808,"Driver.Packet":14506.607,"Driver.Packet.device_lock":159.196,"Driver.Packet.dispatch":1392.874,"Driver.Packet.draw":11069.7,"Driver.Packet.execute":391.496,"Driver.Packet.flip_flush":7.709,"Driver.Packet.flush_between_packets":460.975,"Driver.Packet.memory_wait":0.029,"Driver.Packet.pipeline_drain":233.91,"Driver.Packet.pipeline_prepare":273.712,"Driver.Packet.prepare_memory":245.672,"Driver.Packet.rendering_wait":0.505,"Driver.Present":2662.344,"Driver.Present.acquire_image":2.883,"Driver.Present.device_setup":0.156,"Driver.Present.gpu_mutex_wait":20.944,"Driver.Present.inflight_wait":0.598,"Driver.Present.present_display_buffer":38.354,"Driver.Present.queue_present":43.34,"Driver.Present.release_and_callback":1.164,"Driver.Present.render_fence_wait":2554.178,"Driver.Present.resize":0.424,"Driver.Present.validate":0.068,"Driver.Suspend":0.073,"GpuMutex.wait.dispatch":0.021,"GpuMutex.wait.draw":68.839,"GpuMutex.wait.end":0.862,"GpuMutex.wait.fill":0.319,"GpuMutex.wait.flush":0.295,"GpuMutex.wait.label":1.529,"GpuMutex.wait.other":0.963,"GpuMutex.wait.present":20.376,"GpuMutex.wait.wait":4.254,"Graphics.Draw":9157.115,"Graphics.Draw.draw_and_resource_release":7036.098,"Graphics.Draw.index_upload":452.641,"Graphics.Draw.validate":822.511,"Graphics.Draw.vertex_upload":703.748,"Graphics.DrawWithRecipe":720.456,"Graphics.DrawWithRecipe.draw_and_resource_release":674.231,"Graphics.DrawWithRecipe.index_upload":8.742,"Graphics.DrawWithRecipe.validate":14.56,"Graphics.DrawWithRecipe.vertex_upload":15.536,"Recorder.Reap":138.873,"Recorder.Submit":522.57,"Recorder.WaitSerial":2632.212,"Resources.Complete":75.96,"Resources.Prepare":53.456,"Shader.DrawStage":4039.982,"Shader.DrawStage.capture_resources":1829.347,"Shader.DrawStage.materialize":1138.715,"Shader.DrawStage.prepared_invocation":984.256,"Shader.ResolveAbi":161.05,"Shader.ResolveGraphicsAbi":60.452,"Shader.ResolveGraphicsStagesAbi":158.124,"VideoOut.Flip":2663.65,"VideoOut.Flip.completion_mutex_wait":0.418,"VideoOut.Flip.config_mutex_wait":0.031,"VideoOut.Flip.frame_limit":0.193,"VideoOut.Flip.notify_game":8.309,"VideoOut.Flip.present":2651.014,"VideoOut.Flip.validate":0.309,"VideoOut.Flip.vblank_wait":0.203,"VideoOut.Flip.window_prepare":0.391,"VideoOut.Flip.window_title":2.471,"VideoOut.Readiness":0.814,"VideoOut.Readiness.locks_validate":0.346,"Vulkan.Acquire":2.618,"Vulkan.Acquire.acquire_fence_wait":0.454,"Vulkan.Acquire.acquire_image":1.469,"Vulkan.Acquire.fence_reset":0.498,"Vulkan.Acquire.retired_swapchains":0.114,"Vulkan.Dispatch":183.046,"Vulkan.Dispatch.command_record":60.304,"Vulkan.Dispatch.shader_resources":121.575,"Vulkan.DispatchRecipe":1.001,"Vulkan.DispatchRecipe.command_record":1.0,"Vulkan.DrawFromRecipe":732.406,"Vulkan.Present":20.017,"Vulkan.Present.command_record_scale":8.259,"Vulkan.Present.pixel_upload":0.834,"Vulkan.Present.queue_submit":10.653,"Vulkan.QueuePresent":42.594,"Vulkan.QueuePresent.queue_present":42.223,"Vulkan.Retire":2553.945,"Vulkan.Retire.wait":2549.029},"top_phases_ms_per_frame":{"Driver.Packet":63.906,"Driver.Packet.draw":48.765,"Driver.Draw":47.878,"Graphics.Draw":40.34,"Graphics.Draw.draw_and_resource_release":30.996,"Driver.Draw.shader_compile_and_link":27.546,"Shader.DrawStage":17.797,"VideoOut.Flip":11.734},"owned_draw_counts":{"OwnedDraw.evicted_other":1073},"graphics_track":{"Graphics.Barrier.copy":908,"Graphics.Barrier.dispatch-lead":1381,"Graphics.Barrier.dispatch-trail":2500,"Graphics.Barrier.draw":37200,"Graphics.Barrier.fill-clear":2270,"Graphics.Barrier.label-run":39077,"Graphics.Barrier.present-blit":454,"Graphics.Barrier.shadow-publish":2,"Graphics.Barrier.staging-in":2110,"Graphics.Barrier.staging-out":454,"Graphics.Barrier.storage-upload":25888,"Graphics.Barrier.storage-writeback":2319,"Graphics.BarrierMerged.dispatch-lead":1119,"Graphics.BarrierMerged.label-run":11,"Graphics.BarrierMerged.shadow-publish":2,"Graphics.BarrierMerged.staging-in":164,"Graphics.BarrierMerged.staging-out":454,"Graphics.BarrierMerged.storage-writeback":418,"Graphics.Copy":1364,"Graphics.Copy.bytes":14557152,"Graphics.RenderPass":18367,"Graphics.RenderPass.Close.command":6740,"Graphics.RenderPass.Close.image":16,"Graphics.RenderPass.Close.key":892,"Graphics.RenderPass.Close.label":11,"Graphics.RenderPass.Close.new-batch":10708,"Graphics.RenderPass.Continued":461181},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.915,"events_lost":516113,"totals_full":false},"draw committer":{"events_full_after_s":13.764,"events_lost":22165,"totals_full":false}},"trace":"aps5-trace-da362924bd6a-24316.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 516113 events lost; buffer full at 4915.3 ms; over the 72 of 227 frames that ended before it: busy 42.4 ms per frame (62 %), wait 0.0, largest Driver.Packet 42.4, Driver.EndSubmission 0.0 (the thread table divides the retained slices by every frame)
  • draw committer: 22165 events lost; buffer full at 13764.0 ms; over the 207 of 227 frames that ended before it: busy 29.7 ms per frame (45 %), wait 0.3, largest Graphics.Draw 24.6, Vulkan.DrawFromRecipe 2.7 (the thread table divides the retained slices by every frame)

Slowest frames (largest slices inside each, inclusive)

  • present 4474: 107.3 ms at 3261 ms: Driver.Packet (queue worker 0x0) 91.4, Driver.Packet.draw (queue worker 0x0) 75.5, Driver.Draw (queue worker 0x0) 73.9, Graphics.Draw (draw committer) 36.8
  • present 4477: 99.4 ms at 3535 ms: Driver.Packet (queue worker 0x0) 80.4, Driver.Packet.draw (queue worker 0x0) 64.7, Driver.Draw (queue worker 0x0) 63.2, Graphics.Draw (draw committer) 43.2
  • present 4476: 87.6 ms at 3447 ms: Driver.Packet (queue worker 0x0) 71.7, Driver.Packet.draw (queue worker 0x0) 62.2, Driver.Draw (queue worker 0x0) 60.6, Graphics.Draw (draw committer) 46.4
  • present 4593: 85.7 ms at 11175 ms: Graphics.Draw (draw committer) 36.9, batch (gpu) 34.0, Graphics.Draw.draw_and_resource_release (draw committer) 13.0, VideoOut.Flip (presenter) 11.4
  • present 4469: 82.5 ms at 2903 ms: Driver.Packet (queue worker 0x0) 58.8, Driver.Packet.draw (queue worker 0x0) 49.7, Driver.Draw (queue worker 0x0) 48.4, batch (gpu) 33.4

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 4474: 107.3 ms at 3261 ms, persistence 50.7 ms
  • present 4593: 85.7 ms at 11175 ms, persistence 29.0 ms
  • present 4469: 82.5 ms at 2903 ms, persistence 20.9 ms
  • present 4477: 99.4 ms at 3535 ms, persistence 20.9 ms
  • present 4569: 78.1 ms at 9582 ms, persistence 19.2 ms
  • present 4588: 77.7 ms at 10845 ms, persistence 18.1 ms
  • present 4633: 75.7 ms at 13780 ms, persistence 17.7 ms
  • present 4507: 74.6 ms at 5558 ms, persistence 14.8 ms
  • present 4440: 74.6 ms at 982 ms, persistence 14.3 ms
  • present 4426: 73.5 ms at 66 ms, persistence 13.4 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 11.6 (18 %) 54.5 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 13.5 (20 %) 0.0 (0 %) 52.7 43.4 Driver.Packet 13.5, Driver.EndSubmission 0.0
draw committer 27.1 (41 %) 0.3 (0 %) 38.7 41.9 Graphics.Draw 22.5, Vulkan.DrawFromRecipe 2.5
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
presenter 0.4 (1 %) 11.3 (17 %) 54.4 0.1 VideoOut.Flip 11.7, Driver.Present 0.1
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 66.1 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 30.7 (46 %) 0.0 (0 %) 35.4 0.0 batch 30.7

Largest slices (ms per frame, inclusive, all threads): batch 30.7, Graphics.Draw 22.5, Driver.Packet 13.5, VideoOut.Flip 11.7, Driver.Present 11.7, VideoOut.Flip.present 11.7, Recorder.WaitSerial 11.6, Driver.Present.render_fence_wait 11.3, Vulkan.Retire 11.3, Vulkan.Retire.wait 11.2

Longest waits

  • Recorder.WaitSerial (title) 13.8 ms at 12547 ms, present 4613
  • Recorder.WaitSerial (title) 13.7 ms at 12419 ms, present 4611
  • Recorder.WaitSerial (title) 13.7 ms at 8162 ms, present 4547
  • Recorder.WaitSerial (title) 13.7 ms at 8487 ms, present 4552
  • Recorder.WaitSerial (title) 13.6 ms at 11916 ms, present 4603
  • Recorder.WaitSerial (title) 13.6 ms at 12947 ms, present 4619
  • Recorder.WaitSerial (title) 13.6 ms at 9396 ms, present 4565
  • Recorder.WaitSerial (title) 13.6 ms at 2447 ms, present 4461
  • Recorder.WaitSerial (title) 13.5 ms at 8099 ms, present 4545
  • Recorder.WaitSerial (title) 13.5 ms at 3116 ms, present 4472

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 15410: 5.6 ms at 14953 ms, present 4650: GPU no ranges; recorded by no CPU slices
  • batch 315: 5.6 ms at 335 ms, present 4429: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1
  • batch 523: 5.6 ms at 523 ms, present 4432: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.3, Driver.Packet.dispatch (queue worker 0x0) 1.9, Driver.Dispatch (queue worker 0x0) 1.9, Driver.Dispatch.decode_key_device_setup (queue worker 0x0) 0.6
  • batch 5481: 5.6 ms at 5421 ms, present 4504: GPU no ranges; recorded by no CPU slices
  • batch 8394: 5.5 ms at 8220 ms, present 4547: GPU no ranges; recorded by no CPU slices

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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 GeForce RTX 2080 Ti, driver 610.88, Windows 11 10.0.26300
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes
    • Improved graphics resource handling so recycled descriptor allocations are reused only when their layout and variable descriptor count match.
    • Improved descriptor-pool sizing during draw setup, helping allocations work correctly when pool sizes have not yet been calculated.

A draw that reads copies makes its own descriptor sets, one per split
set, in writeDrawSets. Each draw rebuilt the per-type descriptor counts
of both sets, although the counts are only used when the descriptor
cache has no recycled set to hand out, which on Sonic Origins' S3K page
is almost never once the first draws have run. A recycled set was also
copied out of the cache where it can be moved.

DescriptorCache::TakeRewritten moves a recycled set out, and the counts
are built on a miss only. The index of in-place elements is built only
for a draw that has some.

On the S3K menu page, with writeDrawSets rotating per call between the
old and the new body in one run so that machine state cancels, the old
body took 1334 and 1294 ns per call in two runs and the new one 1156 and
1097 ns (-13% and -15%), about 190 ns for each of the 36,000 draws a
second. The frame is flat.
@github-actions github-actions Bot added the agc libSceAgc* label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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 1395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9335 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9895 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10351 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11825 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13796 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14262 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15529 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 16953 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 17056 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17611 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 19821 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20010 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20153 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20248 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 20728 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20845 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 21199 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 23252 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23258 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23281 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23818 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24049 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24083 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24327 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24661 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 24735 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25534 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25557 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26197 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26630 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26706 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26913 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 27171 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 27343 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 27698 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28142 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@github-actions github-actions Bot added the perf Performance change label Nov 24, 2026
@upipibi

upipibi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Update 2026-11-27, head 835cdd5407 (main merged in; the change no longer touches the in-place hunks main reworked), built at the head as is, same machine and setup: the same 4 tests passed 4/4 in all 3 runs. Validation layer inserted in each Vulkan test, 0 VUID- messages.

RTX 3070 run of d5612492a5, merged with --no-ff onto main aae1ec1424, against main alone.

Tested

  • NVIDIA GeForce RTX 3070 (driver 616.56, subgroup 32), Windows 11 Pro 26100, WinLibs GCC 15.2.0, Ninja, Release; ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.
  • ctest -R "^(agc_descriptor_cache|agc_driver_dispatch_rebind|agc_driver_pipelined_flush_read_order_draw_pipeline|agc_driver_graphics)$", 3 runs each:
    • main: 4/4 passed in all 3 runs.
    • this PR: 4/4 passed in all 3 runs.
  • Validation layer inserted in every Vulkan test (3 per run on the PR side), 0 VUID- messages. Build: 0 failed targets.

Not tested: AMD, titles.

AI-assisted (Claude Code).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 25, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head d5612492a5576979019fcf074400d026f998467f using the prepared diff and the pinned repo_read.py reader. I read the changed hunks and relevant context in all three changed files; the rest of the large .cpp and test files was not read. No commands or tests were run. The description reports author-run tests and performance measurements; I did not independently verify them.

Results

Check Result Note
Changed code review passed No concrete defect found in inspected changes
Tests not run Reader access only
Negative control not run No test execution available

Negative control

Could not run a negative control because tests could not be run in this review environment.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

The uninspected portions of the changed .cpp and test files, other platforms and GPUs, the full test suite, and the author-reported tests and performance results were not independently verified. The prepared bundle excludes no changed files; full file text for ShaderResources.cpp and Graphics.cpp was too large for the bundle, so I inspected targeted ranges through the reader.

To get this to a good state

Nothing is required.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

I merged main into your branch (835cdd5) to resolve the conflict in ShaderResources.cpp. Main removed DrawBindings::inPlace in #26583, so both conflict hunks take main's side and your guarded in-place index is dropped. Your lazy descriptor sizing, TakeRewritten and tests are unchanged. I have not built or measured the merged head, and your -13/-15% on writeDrawSets was measured with the in-place skip included.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Descriptor allocation reuse

Layer / File(s) Summary
Matching recycled allocations
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
DescriptorCache::TakeRewritten returns a recycled allocation that matches the layout and variable descriptor count.
Draw-set allocation integration
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
writeDrawSets computes pool sizes lazily and tries TakeRewritten before Allocate. Tests cover empty and mismatched lookups, successful retrieval, and repeated lookup.

Possibly related issues

  • Issue 17533: The issue describes per-draw CPU cost in descriptor-set writes. This change modifies writeDrawSets and descriptor-set allocation work.
  • Issue 11795: The issue describes per-draw resource construction and cache misses. This change defers descriptor sizing and changes allocation work in the ShaderResources path.

Suggested reviewers: eaglebearerys, milescoviello

Change: Refactor

Merge Risk: Minimal · up to 835cd

This change reuses recycled descriptor sets during draw-set allocation and defers pool-size computation. No concrete defect was found, and the tests cover the new lookup. The reported performance gain may be smaller after the merge from main, but this does not block merging.

Security architecture risk: Minimal · up to 835cd

The optimization skips allocation work when a compatible descriptor set is already available. It preserves which sets can be reused, how they are released, and when a draw can use them.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Cppcheck (2.22.0)

Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

Cppcheck interrupted; analysis of this file is incomplete

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af969092-289d-4408-a964-33b7632b44bc
Commits

Reviewing files that changed from the base of the PR and between ea49f32 and 835cdd5.

Files selected for processing: 3

  • core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

The inspected changes preserve the existing allocation and descriptor sizing behavior; runtime checks were not run in this review.

What I ran

Read the prepared description, commit list, manifest, and diff for head 835cdd540780d763f548e31567bd680c9c288e7c. Read the changed header declaration, the changed implementation ranges and their relevant callers, and the changed descriptor cache test range. No commands or tests were run.

Results

Check Result Note
Diff and targeted source review passed Three changed files inspected
Tests in this review not run No execution environment available
Author-reported checks not run Description reports focused tests and performance measurements

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full implementation and test files were not read beyond the relevant ranges. Tests and performance measurements described by the author were not independently verified. The description says the in-place index is built only when in-place elements exist, but the inspected code still fills snapshotIndices unconditionally; I did not include this as a finding because the relevant lines are unchanged and findings must cite changed lines.

Files read: ShaderResources.hpp, targeted ranges of ShaderResources.cpp, targeted range of Graphics.cpp, plus description.md, commits.md, manifest.json, and diff.patch. Excluded from full-text reading: the remainder of ShaderResources.cpp and Graphics.cpp (both exceed the review bundle limit). No changed file was wholly read.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 28, 2026
@oneandonlydean
oneandonlydean merged commit b850727 into boykopovar:main Nov 29, 2026
15 of 17 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Dec 6, 2026
12 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants