Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
1be4230
perf(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP)
Raghav314 Oct 19, 2026
086fd88
chore(agc): heap coverage, set-bind and fallback counters under APS5_…
Raghav314 Oct 19, 2026
79b497d
fix(agc): find a joined import run from its first piece; count boot-s…
Raghav314 Oct 20, 2026
404ccd1
fix(agc): agree heap mode across a draw's stages before refusing the …
Raghav314 Oct 20, 2026
113a6e1
perf(agc): keep unchanged heap stage data spans instead of rewriting …
Raghav314 Oct 20, 2026
725a421
perf(agc): reuse a GPU-mode stage's shader data span when its inputs …
Raghav314 Oct 20, 2026
583e604
chore(agc): name the descriptor binding that keeps a stage off the he…
Raghav314 Oct 20, 2026
fcb79ef
perf(agc): detile and repack through buffer addresses when the descri…
Raghav314 Oct 20, 2026
b280ff4
perf(agc): keep heap spans until the ring comes back, detile images o…
Raghav314 Oct 20, 2026
9b5fa9f
fix(agc): release swept storage owners after the heap locks
Raghav314 Oct 20, 2026
0513ad7
perf(agc): refresh a fast-cleared storage image in place, CMASK clear…
Raghav314 Oct 20, 2026
730b98a
chore(agc): time heap ring waits and slot sweeps in the [gpu-heap] line
Raghav314 Oct 20, 2026
3ae07ec
perf(agc): age the heap walk memo instead of clearing it when full
Raghav314 Oct 20, 2026
949e8a0
feat(agc): image atomics through image tables, on the descriptor heap…
Raghav314 Oct 20, 2026
711e5c5
chore(agc): drop the heap ring, sweep and revalidate-time hunt timers
Raghav314 Oct 20, 2026
e4a517c
perf(agc): presentation pass draws from the descriptor heap
Raghav314 Oct 20, 2026
14c6af4
fix(agc): keep heap ring words on relocated draw-cache variants
Raghav314 Oct 20, 2026
6ec4137
fix(agc): keep a ring hit's shader data words beyond the user words
Raghav314 Oct 20, 2026
c5ec4dc
perf(agc): drain the old heap walk memo generation per insert
Raghav314 Oct 20, 2026
55361e0
chore(agc): heap stage cost timers in the [gpu-heap] line under APS5_…
Raghav314 Oct 20, 2026
04ca39c
chore(agc): heap walk memo insert and guard timers in the [gpu-heap] …
Raghav314 Oct 20, 2026
faa10c1
perf(agc): admit a heap walk into the memo on the second sighting of …
Raghav314 Oct 20, 2026
dd60d02
perf(agc): store thread-dimension dispatch limits in the heap ring
Raghav314 Oct 21, 2026
cbc10e6
perf(agc): hold 2048 samplers in the GPU heap and turn it off on devi…
Raghav314 Oct 21, 2026
a24ef5a
test(agc): a draw whose fragment stage does not map onto the heap tak…
Raghav314 Oct 22, 2026
eb7b736
fix(agc): rebind the descriptor heaps after push constants put a comm…
Raghav314 Oct 22, 2026
a3a04de
test(agc): skip the GPU heap draw and journal tests without a descrip…
EagleBearerYS Oct 22, 2026
ece08c8
fix(agc): keep GPU heap pipelines in their own journal
Raghav314 Oct 22, 2026
b744510
fix(agc): keep GLC buffer accesses coherent through buffer addresses
Raghav314 Oct 23, 2026
76a8bf3
fix(agc): keep buffer accesses coherent through buffer addresses afte…
Raghav314 Oct 23, 2026
9719c4a
test(agc): build and run the heap draw sample and refresh proof tests…
EagleBearerYS Oct 24, 2026
e57f040
test(agc): keep the image table atomics key wave-uniform on narrow su…
EagleBearerYS Oct 24, 2026
f6ed4bb
fix(agc): re-query the address of a pooled allocation that has none
EagleBearerYS Oct 24, 2026
a5f62f6
feat(agc): map pixel function LDS onto the GPU heap
Raghav314 Oct 24, 2026
436a82d
refactor(agc): split the GPU heap's long functions and wrap its lines
Raghav314 Oct 24, 2026
58490b5
fix(agc): resolve a cached heap stage's image table from the draw's o…
Raghav314 Oct 24, 2026
5f01a66
test(agc): give the compute heap sample's variants the Windows libc PATH
Raghav314 Oct 24, 2026
3005414
test(agc): skip the heap compute sample when the requested heap canno…
Raghav314 Oct 24, 2026
1607542
fix(agc): keep the heap's swept storage in HostThreadLocal
Raghav314 Oct 24, 2026
eb9d658
fix(agc): share the GPU heap's image slots between binding kinds
Raghav314 Oct 24, 2026
5645b5b
fix(agc): refuse the GPU heap when storage and view slots fill the sh…
Raghav314 Oct 24, 2026
493d5fa
fix(agc): put libc on PATH for the Windows GPU heap test variants
Raghav314 Oct 25, 2026
ab39592
Merge main into PR branch
oneandonlydean Oct 25, 2026
6371330
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Oct 25, 2026
3b0df6a
fix(shader): keep the GPU heap's stage templates in one byte budget a…
Raghav314 Oct 25, 2026
82c5714
fix(shader): charge everything a heap template owns and evict the lea…
Raghav314 Oct 25, 2026
945c8be
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Oct 25, 2026
1a59442
fix(agc): send dispatches to the per-dispatch path when the heap runs…
Raghav314 Oct 25, 2026
10f9d8f
fix(agc): release storage images that hold several heap slots once th…
Raghav314 Oct 25, 2026
7d3ea2d
fix(agc): release heap slots of images that left the storage cache
Raghav314 Oct 26, 2026
6275369
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Oct 26, 2026
2a222e3
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Oct 29, 2026
63dcd26
test(agc): put libc on the heap-view sampled cache test's Windows PATH
EagleBearerYS Oct 29, 2026
4aa75cb
refactor(agc): move the heap walk memo into its own header
EagleBearerYS Oct 28, 2026
b7ac0d6
fix(agc): cap the heap walk memo by bytes
EagleBearerYS Oct 28, 2026
96f38b8
fix(agc): match a cached draw's stages only in one heap mode
milescoviello Oct 29, 2026
fc7f440
feat(agc): report the heap walk memos' held bytes on the [gpu-heap] c…
Raghav314 Oct 29, 2026
981351a
fix(agc): evict the heap walk memo by last use and charge each object…
Raghav314 Oct 29, 2026
63400e5
fix(agc): keep the storage texture cache alive through exit like the …
Raghav314 Oct 29, 2026
d8c243b
Merge remote-tracking branch 'origin/main' into perf/agc-vk-descripto…
Raghav314 Oct 29, 2026
60e99e0
fix(agc): check guest buffers for multisample targets when a draw or …
Raghav314 Oct 30, 2026
f20ea04
Merge remote-tracking branch 'origin/main' into perf/agc-vk-descripto…
Raghav314 Oct 30, 2026
bbb446f
feat(agc): carry a device image table trailer in the heap table map
EagleBearerYS Oct 22, 2026
d48d173
feat(agc): add a hashed key table for image descriptors
fable-void Oct 14, 2026
3aa9bc5
feat(agc): key device images by their sampler words and reach the tab…
EagleBearerYS Oct 22, 2026
b9232e5
feat(agc): keep a device image table on the GPU heap's slots
EagleBearerYS Oct 22, 2026
bdea78a
feat(agc): keep device image entries fresh across own stores and unwa…
EagleBearerYS Oct 22, 2026
85b3d40
feat(shader): read device image table columns in GPU-mode stages
EagleBearerYS Oct 22, 2026
aef54d9
feat(agc): expect device image keys before a GPU-mode batch
EagleBearerYS Oct 22, 2026
8cf949d
feat(agc): turn the device image path on with APS5_GPU_PATH
EagleBearerYS Oct 22, 2026
447b798
fix(agc): write the device image table's header when it is created
EagleBearerYS Oct 24, 2026
ba06ceb
fix(shader): give this PR's recompiler change its own disk cache form…
EagleBearerYS Oct 29, 2026
d600dfa
fix(agc): let a memory recovery evict sampled textures the GPU heap s…
milescoviello Oct 30, 2026
9188f74
test(agc): a memory recovery frees a heap-held sampled texture and st…
milescoviello Oct 30, 2026
82f76ff
Merge remote-tracking branch 'origin/main' into perf/agc-vk-descripto…
Raghav314 Oct 30, 2026
d933a0e
test(shader): round-trip the device image table fields through the sh…
EagleBearerYS Oct 30, 2026
3ca628f
Merge perf/agc-vk-descriptor-heap into feat/agc-device-image-table
EagleBearerYS Oct 30, 2026
284f57a
Merge main into feat/agc-device-image-table
EagleBearerYS Oct 30, 2026
88ad9e8
Merge main into feat/agc-device-image-table
EagleBearerYS Oct 30, 2026
dee0aca
fix(agc): route heap stages that do not fit or are excluded to per-draw
Raghav314 Oct 30, 2026
dfe95cc
test(agc): let the depth remap, prepared graphics and lazy ABI tests …
Raghav314 Oct 30, 2026
19f1c84
perf(shader): read heap ring and BDA table words through read-only po…
Raghav314 Oct 30, 2026
8a590dd
perf(shader): load flattened SRT words without a branch per load
Raghav314 Oct 30, 2026
80ab616
perf(shader): read heap buffers through read-only pointers when the s…
Raghav314 Oct 30, 2026
1e30fbb
perf(shader): load heap buffer words without a branch, clamping out-o…
Raghav314 Oct 30, 2026
41f8d1c
perf(agc): copy a heap image slot from the view's encoded descriptor …
Raghav314 Oct 31, 2026
4ea221b
perf(agc): resolve each Vulkan device function once per device instea…
Raghav314 Oct 31, 2026
fd802c3
fix(agc): keep the GPU heap off on drivers and validation layers olde…
Raghav314 Oct 31, 2026
039b020
fix(shader): drop the heap slot words of bindings a specialized modul…
Raghav314 Oct 31, 2026
4d15455
feat(agc): check heap storage image slots under APS5_VERIFY_GPU_HEAP
Raghav314 Oct 31, 2026
ec6c2f3
test(agc): run the storage image tests' compute stages on the GPU heap
Raghav314 Oct 31, 2026
1817bbe
fix(agc): make no draw recipe from an address-space reuse build
EagleBearerYS Oct 31, 2026
270d43a
fix(agc): give the cached address space back when a hit throws before…
EagleBearerYS Oct 31, 2026
758d23c
fix(agc): give the retaken address space back when a draw ends withou…
EagleBearerYS Oct 31, 2026
229b988
perf(agc): read GPU heap shader data as a uniform buffer mapped from …
Raghav314 Oct 31, 2026
eb60688
fix(agc): bind multisampled storage targets on the GPU heap through t…
Raghav314 Oct 31, 2026
95e1f33
fix(agc): give heap image tables a uint storage column for raw uint s…
Raghav314 Oct 31, 2026
fcc10ec
Merge remote-tracking branch 'origin/main' into fix/9508-heap-review
Raghav314 Oct 31, 2026
28c310d
fix(shader): keep zeroing out-of-range GPU heap address loads
Raghav314 Oct 31, 2026
68c1327
test(agc): skip the image table store test without the GPU heap
Raghav314 Oct 31, 2026
9263a4b
fix(agc): gate the GPU heap on the descriptor heap extension's revisi…
Raghav314 Oct 31, 2026
dd7120c
Merge remote-tracking branch 'origin/main' into fix/9508-heap-review
Raghav314 Oct 31, 2026
6407d56
Merge #9508 (dd7120c648) into feat/agc-device-image-table
EagleBearerYS Oct 31, 2026
0f3e74a
test(agc): set the heap slot cap before the device opens
EagleBearerYS Oct 31, 2026
525408a
Merge main into feat/agc-device-image-table
EagleBearerYS Oct 31, 2026
aa86660
fix(agc): free retired depth surfaces that only GPU heap slots sample
Raghav314 Oct 31, 2026
0ab5f15
Merge remote-tracking branch 'origin/main' into fix/9508-heap-review
Raghav314 Oct 31, 2026
22cead4
Merge #9508 (0ab5f157a8) into feat/agc-device-image-table
EagleBearerYS Oct 31, 2026
653edfe
fix(agc): GPU heap slots hold no reference to what they name
Raghav314 Oct 31, 2026
4243e9c
refactor(agc): tidy the GPU heap core
Raghav314 Oct 31, 2026
dd83293
refactor(agc): GPU heap slot owners share one base and slot pool
Raghav314 Oct 31, 2026
31f5d0e
fix(agc): recheck a space-reuse hit's BDA table against new multisamp…
Raghav314 Oct 31, 2026
675e238
refactor(agc): tidy the heap draw and dispatch paths
Raghav314 Oct 31, 2026
3787853
refactor(agc): tidy the heap resource, pipeline and descriptor paths
Raghav314 Oct 31, 2026
06eba99
fix(shader): name every device image interface field its duplicate ch…
EagleBearerYS Oct 31, 2026
866bd70
refactor(shader): tidy the GPU heap recompiler paths
Raghav314 Oct 31, 2026
b5065a1
Merge #9508 (31f5d0e8dd) into feat/agc-device-image-table
EagleBearerYS Oct 31, 2026
7b7d146
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Oct 31, 2026
11ef9c5
fix(agc): let one draw's shader data span several heap ring chunks
Raghav314 Oct 31, 2026
dfd8a5e
fix(agc): never wrap a heap ring span onto the current chunk behind i…
Raghav314 Oct 31, 2026
936b817
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 1, 2026
f2449f6
test(agc): create the GPU heap before the memory accounting baseline
Raghav314 Nov 1, 2026
37c94cd
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 1, 2026
fc0cf93
refactor(agc): keep the heap walk memo's internals private
Raghav314 Nov 1, 2026
1cd3c3b
feat(agc): replay shader requests against a GPU heap target
Raghav314 Nov 1, 2026
0f4b636
refactor(shader): share the GPU heap emitter helpers
Raghav314 Nov 1, 2026
09cc865
test(agc): tidy the GPU heap tests
Raghav314 Nov 1, 2026
715097e
Merge #9508's 09cc865e29 into feat/agc-device-image-table
EagleBearerYS Nov 1, 2026
a03c7aa
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 1, 2026
a0ae8dc
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 2, 2026
b9a210e
test(agc): report the heap ring large-span test as skipped when the r…
Raghav314 Nov 2, 2026
bcb8efa
fix(shader): round-trip the heap profile and the other keyed target f…
Raghav314 Nov 2, 2026
268a7a3
feat(agc): replay a request with its captured heap profile unless ove…
Raghav314 Nov 2, 2026
4087aee
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 2, 2026
f3a1d40
perf(agc): relocate cached heap draws across moved user-data V#s
Raghav314 Nov 2, 2026
7df3710
test(agc): run the user-data V# relocation test on the GPU heap
Raghav314 Nov 2, 2026
ff64a9a
fix(shader): write shader requests as serialization version 55
Raghav314 Nov 2, 2026
1c61dc5
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 2, 2026
290783a
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 3, 2026
8e07d51
fix(shader): keep GPU-mode compute scratch in function storage
Raghav314 Nov 3, 2026
af7ee21
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 3, 2026
c2747b9
fix(agc): clamp compacted indices by the draw's own heap vertex attri…
Raghav314 Nov 3, 2026
4bd2c7d
perf(agc): back GPU-mode compute scratch with the scratch pool
Raghav314 Nov 3, 2026
7bf7e13
fix(agc): size indirect draws' vertex buffers from the draw's heap words
Raghav314 Nov 3, 2026
64de7b5
test(agc): word the presentation pass host-memory skip as a device li…
Raghav314 Nov 3, 2026
547ff94
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 3, 2026
4353aab
perf(agc): keep the descriptor heaps bound across the indirect argume…
Raghav314 Nov 3, 2026
7807948
perf(agc): bind GPU-heap guest buffers and the flattened SRT through …
Raghav314 Nov 3, 2026
c9bac36
fix(agc): put the push-only dispatch limit check on the lowest-limit …
Raghav314 Nov 3, 2026
39b8256
docs(agc): list the GPU heap's per-draw stages as the code takes them
Raghav314 Nov 3, 2026
0720b80
test(agc): submit a tessellation draw followed by a geometry stage
Raghav314 Nov 3, 2026
63fe18f
fix(agc): keep the ring descriptor scratch vectors out of thread_loca…
Raghav314 Nov 3, 2026
30a84aa
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 3, 2026
0939114
refactor(agc): bind the mesh window, pixel LDS and scratch pool sets …
Raghav314 Nov 3, 2026
98c5370
fix(agc): bind the first-sample copy's set through CmdBindDescriptorSets
Raghav314 Nov 4, 2026
1e5f9b5
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 4, 2026
9ead4fa
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 4, 2026
3807237
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 4, 2026
25987ee
test(agc): run the heap-view recovery check with asynchronous texture…
Raghav314 Nov 4, 2026
6ef6711
perf(agc): run driver-internal passes on the descriptor heap
Raghav314 Nov 4, 2026
bf0d6d1
fix(agc): read guest memory in place in heap stages of address draws
Raghav314 Nov 5, 2026
c461e5b
style(agc): drop the comments added with the in-place heap reads
Raghav314 Nov 5, 2026
2cc21ea
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 5, 2026
a6ecdf8
perf(agc): push heap stages' root and shader data like vkd3d's root s…
Raghav314 Nov 5, 2026
8be80b2
fix(shader): take shader disk cache format 57 above main's 56
Raghav314 Nov 5, 2026
36caa8b
perf(agc): evict idle GPU heap image slots and size the heap from the…
Raghav314 Nov 5, 2026
0978335
fix(agc): count evicted heap slots as free only once a submission cov…
Raghav314 Nov 5, 2026
3e7446f
perf(agc): skip GPU heap ring chunks a batch in flight still reads
Raghav314 Nov 5, 2026
fcb483e
perf(agc): move GPU heap shader data into a growing upload pool
Raghav314 Nov 5, 2026
de1bbf1
fix(agc): submit a GPU heap batch early once it holds half the descri…
Raghav314 Nov 5, 2026
7e88d62
Merge #9508's de1bbf1af3 into feat/agc-device-image-table
EagleBearerYS Nov 6, 2026
92c6dab
fix(agc): keep device image table slots from retiring while a batch s…
EagleBearerYS Nov 6, 2026
fbab1c1
Merge branch 'main'
oneandonlydean Nov 6, 2026
67420fb
Merge #9508's fbab1c1619 into feat/agc-device-image-table
EagleBearerYS Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion 3rdparty/Vulkan-Headers
Submodule Vulkan-Headers updated 63 files
+1 −1 include/vk_video/vulkan_video_codec_av1std.h
+1 −1 include/vk_video/vulkan_video_codec_av1std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_av1std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_h264std.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_vp9std.h
+1 −1 include/vk_video/vulkan_video_codec_vp9std_decode.h
+1 −1 include/vk_video/vulkan_video_codecs_common.h
+2 −1 include/vulkan/vk_icd.h
+3 −0 include/vulkan/vk_layer.h
+1 −1 include/vulkan/vk_platform.h
+213 −41 include/vulkan/vulkan.cppm
+1 −1 include/vulkan/vulkan.h
+1,891 −616 include/vulkan/vulkan.hpp
+1 −1 include/vulkan/vulkan_android.h
+1 −1 include/vulkan/vulkan_beta.h
+585 −47 include/vulkan/vulkan_core.h
+1 −1 include/vulkan/vulkan_directfb.h
+193 −92 include/vulkan/vulkan_enums.hpp
+82 −44 include/vulkan/vulkan_extension_inspection.hpp
+932 −2 include/vulkan/vulkan_format_traits.hpp
+1 −1 include/vulkan/vulkan_fuchsia.h
+2,566 −2,050 include/vulkan/vulkan_funcs.hpp
+1 −1 include/vulkan/vulkan_ggp.h
+3,008 −2,215 include/vulkan/vulkan_handles.hpp
+580 −114 include/vulkan/vulkan_hash.hpp
+9 −1 include/vulkan/vulkan_hpp_macros.hpp
+1 −1 include/vulkan/vulkan_ios.h
+1 −1 include/vulkan/vulkan_macos.h
+1 −1 include/vulkan/vulkan_metal.h
+1 −63 include/vulkan/vulkan_ohos.h
+535 −109 include/vulkan/vulkan_raii.hpp
+1 −1 include/vulkan/vulkan_screen.h
+12 −11 include/vulkan/vulkan_shared.hpp
+278 −29 include/vulkan/vulkan_static_assertions.hpp
+36,480 −5,684 include/vulkan/vulkan_structs.hpp
+203 −81 include/vulkan/vulkan_to_string.hpp
+1 −1 include/vulkan/vulkan_vi.h
+2 −2 include/vulkan/vulkan_video.cppm
+1 −1 include/vulkan/vulkan_video.hpp
+1 −1 include/vulkan/vulkan_wayland.h
+1 −1 include/vulkan/vulkan_win32.h
+1 −1 include/vulkan/vulkan_xcb.h
+1 −1 include/vulkan/vulkan_xlib.h
+1 −1 include/vulkan/vulkan_xlib_xrandr.h
+1 −1 registry/apiconventions.py
+9 −1 registry/base_generator.py
+5 −1 registry/cgenerator.py
+27 −10 registry/generator.py
+1 −1 registry/parse_dependency.py
+25 −10 registry/reg.py
+1 −1 registry/spec_tools/conventions.py
+1 −1 registry/spec_tools/util.py
+1 −1 registry/stripAPI.py
+19,547 −12,687 registry/validusage.json
+1 −1 registry/video.xml
+911 −166 registry/vk.xml
+1 −1 registry/vkconventions.py
+1 −1 registry/vulkan_object.py
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ if(BUILD_TESTING)
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/ControlFlow/include)
add_test(NAME request_serializer COMMAND request_serializer_tests)
set_tests_properties(request_serializer PROPERTIES TIMEOUT 20)
add_test_executable(heap_template_budget_tests
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/tests/HeapTemplateBudgetTests.cpp)
target_include_directories(heap_template_budget_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/core/libs
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/ControlFlow/include)
add_test(NAME heap_template_budget COMMAND heap_template_budget_tests)
set_tests_properties(heap_template_budget PROPERTIES TIMEOUT 20)
find_package(Python3 QUIET COMPONENTS Interpreter)
add_test_executable(shader_ir_use_rewrite_tests
core/shader/recompiler/IntermediateRepresentation/tests/UseRewrite.cpp
Expand Down
57 changes: 52 additions & 5 deletions core/libs/prx/libSceAgcDriver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ add_custom_command(
VERBATIM
)

set(agcTextureDetileAddressedShaderSpv ${agcTextureDetileGeneratedDir}/TextureDetileAddressed.spv)
set(agcTextureDetileAddressedShaderHeader ${agcTextureDetileGeneratedDir}/TextureDetileAddressed_spv.h)
add_custom_command(
OUTPUT "${agcTextureDetileAddressedShaderHeader}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${agcTextureDetileGeneratedDir}"
COMMAND "$<TARGET_FILE:glslang-standalone>" -V --target-env vulkan1.1 -DADDRESSED=1 -o "${agcTextureDetileAddressedShaderSpv}" "${agcTextureDetileShaderSource}"
COMMAND ${CMAKE_COMMAND} -DINPUT=${agcTextureDetileAddressedShaderSpv} -DOUTPUT=${agcTextureDetileAddressedShaderHeader}
-DSYMBOL=TEXTURE_DETILE_ADDRESSED_SPV -P "${CMAKE_CURRENT_SOURCE_DIR}/embed_spirv.cmake"
DEPENDS "${agcTextureDetileShaderSource}" glslang-standalone
VERBATIM
)

set(agcTextureRepackShaderSource ${CMAKE_CURRENT_SOURCE_DIR}/Graphics/shaders/TextureRepack.comp)
set(agcTextureRepackShaderSpv ${agcTextureDetileGeneratedDir}/TextureRepack.spv)
set(agcTextureRepackShaderHeader ${agcTextureDetileGeneratedDir}/TextureRepack_spv.h)
Expand All @@ -207,6 +219,17 @@ add_custom_command(
DEPENDS "${agcTextureRepackShaderSource}" glslang-standalone
VERBATIM
)
set(agcTextureRepackAddressedShaderSpv ${agcTextureDetileGeneratedDir}/TextureRepackAddressed.spv)
set(agcTextureRepackAddressedShaderHeader ${agcTextureDetileGeneratedDir}/TextureRepackAddressed_spv.h)
add_custom_command(
OUTPUT "${agcTextureRepackAddressedShaderHeader}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${agcTextureDetileGeneratedDir}"
COMMAND "$<TARGET_FILE:glslang-standalone>" -V --target-env vulkan1.1 -DADDRESSED=1 -o "${agcTextureRepackAddressedShaderSpv}" "${agcTextureRepackShaderSource}"
COMMAND ${CMAKE_COMMAND} -DINPUT=${agcTextureRepackAddressedShaderSpv} -DOUTPUT=${agcTextureRepackAddressedShaderHeader}
-DSYMBOL=TEXTURE_REPACK_ADDRESSED_SPV -P "${CMAKE_CURRENT_SOURCE_DIR}/embed_spirv.cmake"
DEPENDS "${agcTextureRepackShaderSource}" glslang-standalone
VERBATIM
)

set(agcDispatchArgumentsShaderSource ${CMAKE_CURRENT_SOURCE_DIR}/Graphics/shaders/DispatchArguments.comp)
set(agcDispatchArgumentsShaderSpv ${agcTextureDetileGeneratedDir}/DispatchArguments.spv)
Expand Down Expand Up @@ -357,6 +380,7 @@ set(agcDriverSources
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/DrawCache.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/DrawCacheStatistics.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/DrawCapture.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/HeapStages.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/DrawDecode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/DrawLookup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Execution/src/Driver/Draw/DrawPipeline.cpp
Expand Down Expand Up @@ -435,6 +459,7 @@ set(agcDriverSources
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/DeferredDestruction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/MemoryAccounting.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/PlaceholderImages.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/DescriptorHeapObjects.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/Recorder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/ParallelCompare.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/ShaderInputState.cpp
Expand Down Expand Up @@ -465,6 +490,9 @@ set(agcDriverSources
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/UnitShadow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/Sampler.cpp
${agcSampleOrderShaderHeaders}
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/BindlessHeap.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/DeviceImageKeys.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Graphics/src/DeviceImageTable.cpp
${agcTextureDetileShaderHeader}
${agcReadbackHeaders}
${agcMultisampleUploadHeader}
Expand All @@ -474,6 +502,8 @@ set(agcDriverSources
${agcStagingCopyBackShaderHeader}
${agcTextureDetileImageShaderHeader}
${agcTextureRepackShaderHeader}
${agcTextureDetileAddressedShaderHeader}
${agcTextureRepackAddressedShaderHeader}
${agcDispatchArgumentsShaderHeader}
${agcTextureDetileWordsShaderHeader}
${agcTextureDetileImageWordsShaderHeader}
Expand Down Expand Up @@ -711,14 +741,31 @@ function(agc_add_default_test agcTest)
endif()
endfunction()

function(agc_add_draw_pipeline_test agcTestName)
add_test(NAME ${agcTestName}_draw_pipeline COMMAND ${agcTestName}_tests)
set_tests_properties(${agcTestName}_draw_pipeline PROPERTIES ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1;APS5_DRAW_PIPELINE=1;APS5_PIPELINED_DRAWS=32;APS5_PIPELINE_DISPATCH=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
function(agc_add_env_test agcTestName agcTestTarget)
cmake_parse_arguments(PARSE_ARGV 2 agcEnvTest "NO_WORKING_DIRECTORY" "TIMEOUT" "ARGS;ENV")
add_test(NAME ${agcTestName} COMMAND ${agcTestTarget} ${agcEnvTest_ARGS})
set_tests_properties(${agcTestName} PROPERTIES ENVIRONMENT "${agcEnvTest_ENV}" SKIP_RETURN_CODE 77)
if(NOT agcEnvTest_NO_WORKING_DIRECTORY)
set_tests_properties(${agcTestName} PROPERTIES WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
endif()
if(agcEnvTest_TIMEOUT)
set_tests_properties(${agcTestName} PROPERTIES TIMEOUT ${agcEnvTest_TIMEOUT})
endif()
if(WIN32)
set_tests_properties(${agcTestName}_draw_pipeline PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
set_tests_properties(${agcTestName} PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()
endfunction()

function(agc_add_draw_pipeline_test agcTestName)
agc_add_env_test(${agcTestName}_draw_pipeline ${agcTestName}_tests
ENV ANYPS5_NO_SHADER_CACHE=1 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1)
endfunction()

function(agc_add_gpu_heap_test agcTestName)
agc_add_env_test(${agcTestName}_gpu_heap ${agcTestName}_tests
ENV ANYPS5_NO_SHADER_CACHE=1 APS5_GPU_HEAP=1 APS5_VERIFY_GPU_HEAP=1 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1)
endfunction()

function(agc_add_spirv_mode_tests agcTest)
if(NOT TARGET ${agcTest})
return()
Expand Down Expand Up @@ -1059,7 +1106,7 @@ endif()

if(BUILD_TESTING)
get_directory_property(agcRegisteredTests TESTS)
list(FILTER agcRegisteredTests EXCLUDE REGEX "^(agc_pipeline_journal(_long_paths|_extended_paths)?|agc_driver_pipeline_journal|agc_pipeline_store_replay_growth)$")
list(FILTER agcRegisteredTests EXCLUDE REGEX "^(agc_pipeline_journal(_long_paths|_extended_paths)?|agc_driver_pipeline_journal|agc_driver_pipeline_journal_gpu_heap|agc_pipeline_store_replay_growth)$")
set_property(TEST ${agcRegisteredTests} APPEND PROPERTY ENVIRONMENT "APS5_NO_PIPELINE_JOURNAL=1")
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct DispatchVariant {
std::vector<std::pair<std::uint32_t, std::uint32_t>> shaderDataPatches;
std::uint64_t userDataMask = ~std::uint64_t{0};
std::shared_ptr<const ShaderRecompiler::ShaderVertexStageInfo> vertexInfo;
std::shared_ptr<const ShaderRecompiler::HeapStageWords> ringTemplate;

std::shared_ptr<ShaderMemory> memory;
std::vector<ShaderRecompiler::MemoryRegion> captured;
Expand All @@ -88,7 +89,7 @@ struct DispatchEntry {
};

struct EntryCounters {
std::uint64_t lookups = 0, absent = 0, equal = 0, differing = 0, inaccessible = 0, queuedLabel = 0, flushingImage = 0, publishMoved = 0, pendingMoved = 0, forgetMoved = 0, imagesFlushed = 0, runsSynced = 0, forgetSinceInsert = 0, replaced = 0, inserts = 0, unstable = 0, touches = 0;
std::uint64_t lookups = 0, absent = 0, equal = 0, differing = 0, inaccessible = 0, queuedLabel = 0, flushingImage = 0, publishMoved = 0, pendingMoved = 0, forgetMoved = 0, deviceImageFallbacks = 0, imagesFlushed = 0, runsSynced = 0, forgetSinceInsert = 0, replaced = 0, inserts = 0, unstable = 0, touches = 0;

std::uint64_t runsValidated = 0, runsInserted = 0, retriesEqual = 0, retriesMoved = 0;
double validateUs = 0;
Expand All @@ -112,7 +113,7 @@ struct DataMask {
std::vector<std::pair<std::uint32_t, std::uint32_t>>* live;
};

enum class EntryOutcome { Equal, EqualData, Differing, Inaccessible, QueuedLabel, FlushingImage, PublishMoved, PendingMoved, ForgetMoved };
enum class EntryOutcome { Equal, EqualData, Differing, Inaccessible, QueuedLabel, FlushingImage, PublishMoved, PendingMoved, ForgetMoved, DeviceImageFallback };

bool CacheableResult(const ShaderRecompiler::RecompileResult& compiled);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct PreparedGraphicsStage {
ShaderRecompiler::ShaderStage stage = ShaderRecompiler::ShaderStage::Vertex;
std::uint32_t pushOffset = 0;
std::shared_ptr<const ShaderRecompiler::RecompileResult> registration;
bool heapVariant = false;
};

std::vector<PreparedGraphicsStage> PrepareGraphicsStages(const DrawDecode& decoded, const ShaderRecompiler::SpirvTarget& target, bool deferUnprepared = false);
Expand Down Expand Up @@ -131,6 +132,12 @@ struct StageCapture {
std::uint32_t pushOffset = 0;
ShaderRecompiler::SrtUserDataUse userDataUse;
std::uint64_t userDataMask = ~std::uint64_t{0};
bool direct = false;
bool ring = false;
std::shared_ptr<ShaderRecompiler::HeapStageWords> heapWords;
std::shared_ptr<const std::vector<std::uint32_t>> heapReadWords;

bool Cacheable() const { return !direct || ring; }
};

struct RelocatableUserWord {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#ifndef CORE_LIBS_PRX_LIBSCEAGCDRIVER_EXECUTION_INCLUDE_DRIVER_DRAW_HEAPSTAGES_HPP
#define CORE_LIBS_PRX_LIBSCEAGCDRIVER_EXECUTION_INCLUDE_DRIVER_DRAW_HEAPSTAGES_HPP

#include "Optimization/ResourceProgram.hpp"
#include "UserDataUse.hpp"
#include "prx/libSceAgcDriver/Graphics/include/BindlessHeap.hpp"
#include "prx/libSceAgcDriver/Graphics/include/Shaders.hpp"
#include <cstdint>
#include <memory>
#include <optional>
#include <span>
#include <utility>
#include <vector>

namespace AgcDriver {
class VulkanDevice;
}

namespace AgcDriver::DriverDetail {

bool HeapFragmentsEnabled();
bool HeapRefused();
bool HeapStageExcluded(ShaderRecompiler::ShaderStage stage);
bool HeapPreRasterStage(ShaderRecompiler::ShaderStage stage);
Graphics::HeapStageReason HeapStageIneligibility(ShaderRecompiler::ShaderStage stage, const ShaderRecompiler::IrResourcePlan* plan,
bool heapVertex);
bool HeapStageEligible(ShaderRecompiler::ShaderStage stage, const ShaderRecompiler::IrResourcePlan* plan, bool heapVertex);
enum class HeapKeyClass { Draw, Compute, HeapVertex };

constexpr std::size_t HeapFragmentKey(std::size_t codeOffset, HeapKeyClass keyClass) {
switch (keyClass) {
case HeapKeyClass::Compute: return codeOffset | std::size_t{1} << 61u;
case HeapKeyClass::HeapVertex: return codeOffset | std::size_t{1} << 62u;
case HeapKeyClass::Draw: break;
}
return codeOffset;
}

std::optional<bool> HeapFragmentKnown(const void* snapshot, std::size_t codeOffset);
void NoteHeapFragment(const void* snapshot, std::size_t codeOffset, bool eligible);
bool HeapStageMappable(const ShaderRecompiler::RecompileResult& result, bool workgroupAddress = false);
void SetHeapStageUnmapped(std::optional<ShaderRecompiler::ShaderStage> stage);
bool HeapDrawStageMappable(const ShaderRecompiler::RecompileResult& result, ShaderRecompiler::ShaderStage stage);
bool HeapPairRefused(std::uint64_t pair);
bool ExpectDeviceImages(const VulkanDevice& device, std::span<const std::uint32_t> userData, std::uint64_t codeAddress, const ShaderRecompiler::RecompileResult& result, bool dispatch);
void RefuseHeapPair(std::uint64_t pair);

class HeapDrawOff {
public:
HeapDrawOff();
~HeapDrawOff();
HeapDrawOff(const HeapDrawOff&) = delete;
HeapDrawOff& operator=(const HeapDrawOff&) = delete;

private:
bool previous;
};

bool SampleHeapStageVerify();

struct HeapStageReads {
std::vector<std::pair<std::uint64_t, std::uint64_t>> ranges;
std::vector<std::uint32_t> values;
ShaderRecompiler::SrtUserDataUse userDataUse;
std::shared_ptr<const ShaderRecompiler::ResourceCapture> capture;
bool complete = false;
};

struct HeapStageMaterialized {
std::shared_ptr<const ShaderRecompiler::RecompileResult> result;
std::shared_ptr<const ShaderRecompiler::HeapStageWords> words;
HeapStageReads reads;
};

HeapStageMaterialized MaterializeHeapStage(const ShaderRecompiler::PreparedShaderInvocation& invocation, std::span<const std::uint32_t> userData,
std::uint64_t shaderBase);
void NoteHeapDirect();
void NoteHeapDirectVerify(const ShaderRecompiler::RecompileResult& direct, const ShaderRecompiler::RecompileResult& expected,
const ShaderRecompiler::ResourceCapture* expectedCapture = nullptr);
std::uint64_t HeapStagesTaken();
std::uint64_t HeapRingHitsVerified();
std::uint64_t HeapRingHitsDiffering();
std::shared_ptr<const ShaderRecompiler::RecompileResult> PatchedHeapResult(const ShaderRecompiler::RecompileResult& shared,
const ShaderRecompiler::HeapStageWords& words);
void VerifyHeapAccessor(const Graphics::CompiledShader& stage);
void VerifyRingWords(const ShaderRecompiler::RecompileResult& kept, const ShaderRecompiler::HeapStageWords& ring,
const ShaderRecompiler::RecompileResult& fresh, const ShaderRecompiler::HeapStageWords* freshWords);

}

#endif
Loading
Loading