perf(shader): keep only the layout of unbounded bindless pointer tables #22424
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22424"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by slopezjur on 2026-11-17T14:53:41Z.
What
With the bindless heap of #20519 on, an image table read through a raw pointer whose index the plan cannot bound is capped at
ImageTableAbi::MaxKeys(65,536) records, and every capture still read and compared all of them as descriptors. A heap image never uses those words:ResourceMaterializer::BindlessTablesonly needs which keys are readable and their addresses, the texture service decodes the records from guest memory itself, and a heap image does not read the table map. Ghost of Yōtei keeps two such tables in a double-buffered per-frame arena whose contents change every frame, so two compute dispatches (queue workers 0x30 and 0x38) rebuilt 65,536-key snapshots every frame, the result memo never hit, and both ran on the frame's critical path.A column that is an address column, has no sampler, and is read only by bindless sampled images (
ResourceMaterializer::BindlessImage) now keeps only its layout when the key cap truncates it: the state of each record (read, unmapped, carried), its read ranges and the dword mask each record would read. It reads no record words.WalkColumn, shared by both paths;IndexRecordsandMergeReadRangesare the rest of the old inline code. The read path is unchanged otherwise.LayoutMemos) under the existingColumnKey(base included, so both arena halves are kept) and the same 16-entry / 4 Mi-word limits as the word snapshots, together with every whole-page and word readability answer its walk took. A later capture shares it when each of those answers still holds; the walk is a function of the key and those answers, so the shared layout is the one the walk would build.SrtRuntime::bindlessImagescarriesBindlessLowering(request)into the materializer for captures and forrecompileOnce.APS5_NO_BINDLESS_UNREAD_TABLES=1reads the words as before;APS5_NO_TABLE_SNAPSHOT_REUSE=1also turns the layout reuse off. The[image-table]line counts layout-only columns and reuses.Tests:
agc_driver_image_table_layout_onlyruns the unbounded pointer table ofImageTable.cppthrough the heap with key narrowing off (APS5_IMAGE_TABLE_KEY_SCAN=0, as in the title): the capture reads no table words, both keys sample the same texels as a direct binding of their entry, a second capture reuses the layout and reads the same words in the same variant, and a key past the palette and a key past the key cap still fault.agc_driver_image_table_layout_only_offruns the same case withAPS5_NO_BINDLESS_UNREAD_TABLES=1and requires the words to be read and no layout to be reused.This is the main-driver form of the layout-only snapshot and its reuse from my
yotei/next2fork branch (a222bb6ff6, fa1409d9ad), written against #20519.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release, NVIDIA GeForce RTX 4080 SUPER (driver 621.24).
Tests matching
^(agc_|shader_)withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer, on #20519's head6916aea789and on this change based on it, same machine and GPU:VUID-lines6916aea789agc_driver_stencil_plane_memory,agc_driver_store_over_untracked)The image-table, bindless, texture service and table snapshot tests again with
APS5_BINDLESS_IMAGES=1forced on:VUID-lines6916aea789The 13 (
agc_driver_bindless_images,agc_driver_image_table_array_views,_cache_bounds,_reuse,_variantsand the eightagc_driver_image_table_reuse_*cases) assert per-draw table bindings, which #20519 keeps for the heap-off path only.agc_driver_upload_cache_read_only_flushis not built on either side: its source callssetenv, which this toolchain does not declare. The two failures also fail on #20519 and onmain.Ghost of Yōtei
PPSA26344 v02.002.000, DRS 1080p patch, Digital Deluxe "Press X" screen from a fresh save, warm shader cache,
APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1. Plainmaincrawls in this scene, so both arms use one build ofmaincb28e72762merged with #20018, #20519 and #21501; onlylibSceAgcDriver.prxdiffers between arms. Runs alternate between arms, 360 s each, fps counted from the presents between 220 s and 350 s:Every run with this PR is faster than every base run. GPU busy stays at about 138 ms per present; the gain is CPU time on the async compute workers.
[image-table]per 10 s: base about 2,030 snapshots, 15.3 M keys, 700-740 ms; this PR about 2,290 snapshots, 13.5 M keys, 155-165 layout-only columns of which 138-153 reused, 334-365 ms. From the traces below (ms per frame): queue worker 0x30Driver.Dispatch.materialize21.3 -> 2.3, queue worker 0x38Driver.Dispatch62.3 -> 25.3, worker 0x30 busy 68.9 -> 46.7, worker 0x38 busy 52.2 -> 29.7. Left out: three runs of one round that failed to start because the disk filled up (the driver copy intolibs/failed); they were rerun as a later round. Not measured: other titles, other GPUs, Linux, macOS. These numbers are from #20519 at6916aea789, before its miss-ring store fix2868dd086a; #20519's A/B of that fix ran with this PR in both arms (DLC screen 3.38 -> 5.14 fps), so the gain of this PR on top of the fix is not measured yet. I will rerun the arms on the current base before this leaves draft.tools/trace_digest.py: base (APS5_PROFILE_DRAW=1 APS5_TRACE_SECONDS=270:5)seconds 270:5 from present 1406: 16 presents, frame p50 317.2 / p90 333.6 / p99 336.6 / max 336.6 ms, GPU busy 138.0 ms per present
NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.24, Windows 10.0.26300, 3840x2160, commit c7f52b90ed49, dropped: no
Threads (ms per frame, title threads omitted)
tools/trace_digest.py: this PR (same settings)seconds 270:5 from present 1476: 18 presents, frame p50 289.8 / p90 301.8 / p99 303.1 / max 303.1 ms, GPU busy 139.7 ms per present
NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.24, Windows 10.0.26300, 3840x2160, commit 920841f41faf, dropped: no
Threads (ms per frame, title threads omitted)
aps5-summary.jsonl: base, the trace window of the digest above{"commit":"c7f52b90ed49","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1406,"ms":5105.597},"presents":16,"frame_ms":{"p50":317.160,"p90":333.630,"p99":336.561,"max":336.561},"gpu_busy_ms_per_present":137.989,"worker_busy_pct":{"queue worker 0x0":93.076,"queue worker 0x52":24.014,"queue worker 0x53":22.079,"queue worker 0x20":55.731,"queue worker 0x30":77.703,"queue worker 0x38":65.485,"queue worker 0x48":3.015,"queue worker 0x51":2.711,"queue worker 0x50":72.333},"phase_totals_ms":{"Driver.Completion":0.219,"Driver.Dispatch":7148.679,"Driver.Dispatch.capture_resources":1612.806,"Driver.Dispatch.decode_key_device_setup":935.131,"Driver.Dispatch.lookup_cache":1104.295,"Driver.Dispatch.materialize":551.714,"Driver.Dispatch.prepared_invocation":19.876,"Driver.Draw":429.294,"Driver.Draw.device_setup":5.349,"Driver.Draw.draw_enqueued":76.515,"Driver.Draw.empty_indirect_skipped":2.095,"Driver.Draw.post_compile_prepare":4.639,"Driver.Draw.prepare":32.496,"Driver.Draw.shader_compile_and_link":306.231,"Driver.EndSubmission":18.266,"Driver.Packet":21228.253,"Driver.Packet.device_lock":4.783,"Driver.Packet.dispatch":7827.474,"Driver.Packet.draw":431.381,"Driver.Packet.execute":17.639,"Driver.Packet.flip_flush":0.536,"Driver.Packet.flush_between_packets":57.462,"Driver.Packet.memory_wait":12220.427,"Driver.Packet.pipeline_drain":98.608,"Driver.Packet.pipeline_prepare":7.546,"Driver.Packet.prepare_memory":508.381,"Driver.Packet.rendering_wait":0.027,"Driver.Present":242.114,"Driver.Present.acquire_image":0.190,"Driver.Present.bindless_wait":230.682,"Driver.Present.device_setup":0.011,"Driver.Present.gpu_mutex_wait":0.892,"Driver.Present.inflight_wait":0.036,"Driver.Present.present_display_buffer":2.687,"Driver.Present.queue_present":7.167,"Driver.Present.release_and_callback":0.014,"Driver.Present.render_fence_wait":0.308,"Driver.Present.resize":0.096,"Driver.Present.validate":0.004,"Driver.Suspend":0.027,"GpuMutex.wait.copy":1.461,"GpuMutex.wait.dispatch":1142.693,"GpuMutex.wait.draw":52.724,"GpuMutex.wait.end":10.838,"GpuMutex.wait.fill":15.267,"GpuMutex.wait.flush":70.369,"GpuMutex.wait.hook":1067.594,"GpuMutex.wait.indirect":28.270,"GpuMutex.wait.label":76.851,"GpuMutex.wait.other":2.467,"GpuMutex.wait.present":0.861,"Graphics.Draw":1055.688,"Graphics.Draw.draw_and_resource_release":662.486,"Graphics.Draw.index_upload":243.769,"Graphics.Draw.validate":9.488,"Graphics.Draw.vertex_upload":9.810,"Graphics.DrawWithRecipe":19.430,"Graphics.DrawWithRecipe.draw_and_resource_release":18.094,"Graphics.DrawWithRecipe.index_upload":0.018,"Graphics.DrawWithRecipe.validate":0.180,"Graphics.DrawWithRecipe.vertex_upload":0.196,"Graphics.Submit":0.153,"Graphics.Submit.command_end":0.017,"Graphics.Submit.queue_submit":0.133,"Graphics.Wait":12.435,"Graphics.Wait.fence_wait":12.215,"Recorder.Reap":20.303,"Recorder.Submit":81.380,"Recorder.Sync":233.795,"Recorder.WaitSerial":212.687,"Resources.Complete":380.024,"Resources.Prepare":144.261,"Shader.DrawStage":208.245,"Shader.DrawStage.capture_resources":177.689,"Shader.DrawStage.materialize":21.671,"Shader.DrawStage.prepared_invocation":8.081,"Shader.ResolveAbi":17.733,"Shader.ResolveGraphicsAbi":9.152,"Shader.ResolveGraphicsStagesAbi":25.755,"VideoOut.Flip":246.329,"VideoOut.Flip.completion_mutex_wait":0.015,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":1.904,"VideoOut.Flip.present":243.040,"VideoOut.Flip.validate":0.016,"VideoOut.Flip.vblank_wait":0.009,"VideoOut.Flip.window_prepare":0.020,"VideoOut.Flip.window_title":1.308,"VideoOut.Readiness":0.028,"VideoOut.Readiness.locks_validate":0.013,"Vulkan.Acquire":0.173,"Vulkan.Acquire.acquire_fence_wait":0.027,"Vulkan.Acquire.acquire_image":0.106,"Vulkan.Acquire.fence_reset":0.030,"Vulkan.Acquire.retired_swapchains":0.006,"Vulkan.BindlessPresentWait":230.659,"Vulkan.BindlessPresentWait.after_present_wait":33.607,"Vulkan.BindlessPresentWait.early_prepare":2.516,"Vulkan.BindlessPresentWait.finish_up_to":0.406,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.352,"Vulkan.BindlessPresentWait.present_serial":0.536,"Vulkan.BindlessPresentWait.wait_serial":169.922,"Vulkan.Dispatch":1381.764,"Vulkan.Dispatch.command_record":761.420,"Vulkan.Dispatch.shader_resources":613.305,"Vulkan.DispatchRecipe":83.303,"Vulkan.DispatchRecipe.command_record":82.722,"Vulkan.DrawFromRecipe":19.583,"Vulkan.Present":1.519,"Vulkan.Present.command_record_scale":0.477,"Vulkan.Present.pixel_upload":0.560,"Vulkan.Present.queue_submit":0.470,"Vulkan.QueuePresent":7.133,"Vulkan.QueuePresent.queue_present":7.112,"Vulkan.Retire":0.304,"Vulkan.Retire.wait":0.127},"top_phases_ms_per_frame":{"Driver.Packet":1326.766,"Driver.Packet.memory_wait":763.777,"Driver.Packet.dispatch":489.217,"Driver.Dispatch":446.792,"Driver.Dispatch.capture_resources":100.800,"Vulkan.Dispatch":86.360,"GpuMutex.wait.dispatch":71.418,"Driver.Dispatch.lookup_cache":69.018},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":1059,"Graphics.Barrier.dcc-clear":416,"Graphics.Barrier.dcc-keys":320,"Graphics.Barrier.dispatch-lead":11098,"Graphics.Barrier.dispatch-trail":19168,"Graphics.Barrier.draw":5639,"Graphics.Barrier.fill":407,"Graphics.Barrier.fill-clear":416,"Graphics.Barrier.indirect-args":490,"Graphics.Barrier.input-mirror":165,"Graphics.Barrier.label-run":3594,"Graphics.Barrier.present-blit":32,"Graphics.Barrier.shadow-publish":648,"Graphics.Barrier.staging-in":20392,"Graphics.Barrier.staging-out":9808,"Graphics.Barrier.storage-upload":5180,"Graphics.Barrier.storage-writeback":11965,"Graphics.Barrier.template-refresh":37,"Graphics.BarrierMerged.copy":205,"Graphics.BarrierMerged.dispatch-lead":9050,"Graphics.BarrierMerged.fill":205,"Graphics.BarrierMerged.label-run":18,"Graphics.BarrierMerged.shadow-publish":320,"Graphics.BarrierMerged.staging-in":9002,"Graphics.BarrierMerged.staging-out":9776,"Graphics.BarrierMerged.storage-writeback":1315,"Graphics.Copy":45750,"Graphics.Copy.bytes":20466270816,"Graphics.RenderPass":1793,"Graphics.RenderPass.Close.command":1264,"Graphics.RenderPass.Close.image":88,"Graphics.RenderPass.Close.key":64,"Graphics.RenderPass.Close.label":18,"Graphics.RenderPass.Close.new-batch":359,"Graphics.RenderPass.Continued":2058},"trace_dropped":false,"trace":"aps5-trace-c7f52b90ed49-9728.json.gz"}
aps5-summary.jsonl: this PR, the trace window of the digest above{"commit":"920841f41faf","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1476,"ms":5170.255},"presents":18,"frame_ms":{"p50":289.750,"p90":301.781,"p99":303.125,"max":303.125},"gpu_busy_ms_per_present":139.702,"worker_busy_pct":{"queue worker 0x0":94.315,"queue worker 0x52":23.791,"queue worker 0x53":21.782,"queue worker 0x20":58.698,"queue worker 0x30":75.435,"queue worker 0x38":71.610,"queue worker 0x48":3.407,"queue worker 0x51":4.102,"queue worker 0x50":72.783},"phase_totals_ms":{"Driver.Completion":0.237,"Driver.Dispatch":7106.615,"Driver.Dispatch.capture_resources":1473.626,"Driver.Dispatch.decode_key_device_setup":1112.176,"Driver.Dispatch.lookup_cache":1143.508,"Driver.Dispatch.materialize":76.004,"Driver.Dispatch.prepared_invocation":23.997,"Driver.Draw":529.286,"Driver.Draw.device_setup":5.960,"Driver.Draw.draw_enqueued":95.366,"Driver.Draw.empty_indirect_skipped":0.425,"Driver.Draw.post_compile_prepare":5.321,"Driver.Draw.prepare":39.381,"Driver.Draw.shader_compile_and_link":380.600,"Driver.EndSubmission":65.877,"Driver.Packet":21955.126,"Driver.Packet.device_lock":5.542,"Driver.Packet.dispatch":7846.721,"Driver.Packet.draw":531.606,"Driver.Packet.execute":21.749,"Driver.Packet.flip_flush":0.677,"Driver.Packet.flush_between_packets":68.380,"Driver.Packet.memory_wait":12762.807,"Driver.Packet.pipeline_drain":122.642,"Driver.Packet.pipeline_prepare":8.420,"Driver.Packet.prepare_memory":520.640,"Driver.Packet.rendering_wait":0.022,"Driver.Present":172.105,"Driver.Present.acquire_image":0.225,"Driver.Present.bindless_wait":160.183,"Driver.Present.device_setup":0.012,"Driver.Present.gpu_mutex_wait":0.984,"Driver.Present.inflight_wait":0.041,"Driver.Present.present_display_buffer":3.155,"Driver.Present.queue_present":7.076,"Driver.Present.release_and_callback":0.017,"Driver.Present.render_fence_wait":0.361,"Driver.Present.resize":0.032,"Driver.Present.validate":0.007,"Driver.Suspend":0.060,"GpuMutex.wait.copy":1.431,"GpuMutex.wait.dispatch":1249.292,"GpuMutex.wait.draw":97.076,"GpuMutex.wait.end":25.741,"GpuMutex.wait.fill":15.311,"GpuMutex.wait.flush":53.109,"GpuMutex.wait.hook":1152.408,"GpuMutex.wait.indirect":40.508,"GpuMutex.wait.label":62.357,"GpuMutex.wait.other":1.325,"GpuMutex.wait.present":0.950,"Graphics.Draw":1272.066,"Graphics.Draw.draw_and_resource_release":826.203,"Graphics.Draw.index_upload":294.767,"Graphics.Draw.validate":10.916,"Graphics.Draw.vertex_upload":10.883,"Graphics.DrawWithRecipe":30.782,"Graphics.DrawWithRecipe.draw_and_resource_release":29.403,"Graphics.DrawWithRecipe.index_upload":0.021,"Graphics.DrawWithRecipe.validate":0.193,"Graphics.DrawWithRecipe.vertex_upload":0.211,"Graphics.Submit":0.179,"Graphics.Submit.command_end":0.021,"Graphics.Submit.queue_submit":0.154,"Graphics.Wait":18.123,"Graphics.Wait.fence_wait":17.895,"Recorder.Reap":27.938,"Recorder.Submit":92.111,"Recorder.Sync":302.201,"Recorder.WaitSerial":135.092,"Resources.Complete":428.159,"Resources.Prepare":155.580,"Shader.DrawStage":255.035,"Shader.DrawStage.capture_resources":220.873,"Shader.DrawStage.materialize":23.925,"Shader.DrawStage.prepared_invocation":9.303,"Shader.ResolveAbi":21.180,"Shader.ResolveGraphicsAbi":10.715,"Shader.ResolveGraphicsStagesAbi":22.623,"VideoOut.Flip":175.101,"VideoOut.Flip.completion_mutex_wait":0.016,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.007,"VideoOut.Flip.notify_game":0.069,"VideoOut.Flip.present":173.229,"VideoOut.Flip.validate":0.018,"VideoOut.Flip.vblank_wait":0.011,"VideoOut.Flip.window_prepare":0.022,"VideoOut.Flip.window_title":1.720,"VideoOut.Readiness":0.034,"VideoOut.Readiness.locks_validate":0.015,"Vulkan.Acquire":0.207,"Vulkan.Acquire.acquire_fence_wait":0.030,"Vulkan.Acquire.acquire_image":0.131,"Vulkan.Acquire.fence_reset":0.034,"Vulkan.Acquire.retired_swapchains":0.006,"Vulkan.BindlessPresentWait":160.155,"Vulkan.BindlessPresentWait.after_present_wait":35.906,"Vulkan.BindlessPresentWait.early_prepare":2.701,"Vulkan.BindlessPresentWait.finish_up_to":0.575,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.072,"Vulkan.BindlessPresentWait.present_serial":0.653,"Vulkan.BindlessPresentWait.wait_serial":93.082,"Vulkan.Dispatch":1606.674,"Vulkan.Dispatch.command_record":873.849,"Vulkan.Dispatch.shader_resources":724.613,"Vulkan.DispatchRecipe":81.313,"Vulkan.DispatchRecipe.command_record":80.762,"Vulkan.DrawFromRecipe":30.957,"Vulkan.Present":1.781,"Vulkan.Present.command_record_scale":0.562,"Vulkan.Present.pixel_upload":0.656,"Vulkan.Present.queue_submit":0.551,"Vulkan.QueuePresent":7.043,"Vulkan.QueuePresent.queue_present":7.019,"Vulkan.Retire":0.354,"Vulkan.Retire.wait":0.110},"top_phases_ms_per_frame":{"Driver.Packet":1219.729,"Driver.Packet.memory_wait":709.045,"Driver.Packet.dispatch":435.929,"Driver.Dispatch":394.812,"Vulkan.Dispatch":89.260,"Driver.Dispatch.capture_resources":81.868,"Graphics.Draw":70.670,"GpuMutex.wait.dispatch":69.405},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":1202,"Graphics.Barrier.dcc-clear":468,"Graphics.Barrier.dcc-keys":360,"Graphics.Barrier.dispatch-lead":12600,"Graphics.Barrier.dispatch-trail":22228,"Graphics.Barrier.draw":6746,"Graphics.Barrier.fill":435,"Graphics.Barrier.fill-clear":468,"Graphics.Barrier.indirect-args":552,"Graphics.Barrier.input-mirror":188,"Graphics.Barrier.label-run":4019,"Graphics.Barrier.present-blit":36,"Graphics.Barrier.shadow-publish":723,"Graphics.Barrier.staging-in":23334,"Graphics.Barrier.staging-out":11261,"Graphics.Barrier.storage-upload":5848,"Graphics.Barrier.storage-writeback":13446,"Graphics.Barrier.template-refresh":45,"Graphics.BarrierMerged.copy":252,"Graphics.BarrierMerged.dispatch-lead":10732,"Graphics.BarrierMerged.fill":245,"Graphics.BarrierMerged.label-run":23,"Graphics.BarrierMerged.shadow-publish":363,"Graphics.BarrierMerged.staging-in":10417,"Graphics.BarrierMerged.staging-out":11225,"Graphics.BarrierMerged.storage-writeback":1487,"Graphics.Copy":52173,"Graphics.Copy.bytes":23401830564,"Graphics.RenderPass":2229,"Graphics.RenderPass.Close.command":1618,"Graphics.RenderPass.Close.image":105,"Graphics.RenderPass.Close.key":68,"Graphics.RenderPass.Close.label":23,"Graphics.RenderPass.Close.new-batch":415,"Graphics.RenderPass.Continued":2121},"trace_dropped":false,"trace":"aps5-trace-920841f41faf-32080.json.gz"}
Traces:
aps5-trace-c7f52b90ed49-9728.json.gz(base) andaps5-trace-920841f41faf-32080.json.gz(this PR).Rebased onto #20519
e72eb89fb3Head
5547504903, Windows 11, WinLibs GCC 15.2.0 r7, Release, RTX 4080 SUPER (621.24), the same validation flags as above, against #20519e72eb89fb3built on the same machine. Focused set:ctest -R 'bindless|texture_service|image_table|device_image_keys|agc_shader_memory$|agc_shader_descriptor_phis|shader_disk_cache|bda' -V. Heap-on set:APS5_BINDLESS_IMAGES=1on^agc_driver_image_table(_bindless|_runtime_address)?$,^agc_driver_texture_serviceand^agc_driver_bindless_images:e72eb89fb3agc_driver_image_table_layout_onlyand_off), 56 insertsNo
VUID-line and nowas not found but was requested by env var VK_INSTANCE_LAYERS.tools/check_skips.pypasses, and both layout-only tests created the heap and ran. The rebase picks up #20519's Linux layout guards (42c4144c84), so this head builds on Linux on its own; I have not built it there.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T19:53:39Z.
Review: COMMENTED
perf(shader): keep only the layout of unbounded bindless pointer tables — no blocking findings (partial)
Nothing blocks this; the points below are optional. The review covers only the layout-only hunk of
ResourceMaterializer.cpp, not the whole stack, so it is a comment, not an approval.What I ran
55475049031587d5ed27ac12d08620abe091c492(PR #22424, draft, stacked on #20519e72eb89fb3).core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp(newLayoutMemo,WalkColumn,ReadLayout,ReuseLayout,RememberLayout, and theBindlessImagehelpers).repo_read.pysearch and cat):ResourceMaterializer.cpparoundAddressAccessible,WholePageAccessible,Seal,ReadLayoutandNestedColumn, plus a search forheapSource.Results
ResourceMaterializer.cpponlyagc_driver_image_table_layout_only,_off)Reader commands (paths omitted)
repo_read.py search "addresses"oncore/shader/recompiler/Optimization/src/ResourceMaterializer.cpprepo_read.py search "states"on the same filerepo_read.py search "heapSource"on the same filerepo_read.py search "WholePageAccessible","AddressAccessible","wholePages"on the same filerepo_read.py caton the same file, lines 874–886, 1060–1085, 1400–1415, 1502–1512, 1618–1640Findings
Blocking
None found in the code I read.
Non-blocking
core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:1409(diff hunk at 8165): on a layout reuse hit,ReadLayoutreturns beforerecords.statesandrecords.wordsare assigned (lines 1410–1411 run only on a miss). Nothing reads them on that path today:Sealis not reached, andNestedColumnneeds a buffer parent (line 1129), which a layout-only column never is. The code is correct as written, but a later change that readsrecords.statesafter a reuse would index an empty vector. Moving the twoassigncalls above the reuse check would remove the trap. Confidence: plausible.Not verified
files.jsonlists about 70 reviewed files, and I read the layout hunk of one of them. The commit's own 8 files could not be separated from the stacked #20519 hunks indiff.patch, so I did not map them. Nothing outside the layout hunk is covered by this comment.diff.patchshows the stacked base too, while the description says "+244/-47 in 8 files". I did not reconcile the two.IndexRecordsis called with no read data, so every record of such a column shares one emptyWordsIndexentry). That is correct only if no consumer readscontents.wordsof a layout-only column. I did not check the consumers.ColumnMemoEntriesandColumnMemoWordsare the same 16-entry / 4 Mi-word limits the description states. I did not read their values.VulkanDevice.cppandShaderResources.cppare marked "too large for the review folder" in the manifest, yetfiles.jsonshows no excluded files. I did not read either of them.APS5_NO_BINDLESS_UNREAD_TABLESoff path were not run. The performance numbers are the author's, measured on #20519 at6916aea789before the miss-ring fix. The description says the arms will be rerun on the current base before leaving draft.To get this to a good state
Nothing is required.
records.statesandrecords.wordsassigns inReadLayoutabove the reuse check (see the non-blocking finding).Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:09:53Z.
Review: COMMENTED
I reviewed the final layout-only commit independently of the inherited heap stack. Its cache must invalidate when any captured readability answer changes, even when the descriptor words are intentionally absent. Please keep a check for a formerly unreadable record becoming readable at the same address during cache reuse. The combined draft currently conflicts with
maina1b75b0947, including the bindless ABI and image-table fixture. Paired execution is pending the stack rebase.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.