Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
333 commits
Select commit Hold shift + click to select a range
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
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
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
866bd70
refactor(shader): tidy the GPU heap recompiler paths
Raghav314 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
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
fbab1c1
Merge branch 'main'
oneandonlydean Nov 6, 2026
73c5187
perf(agc): embed constant samplers in GPU heap pipelines
Raghav314 Nov 5, 2026
31d84cf
fix(agc): include embedded sampler state in the compute pipeline iden…
oneandonlydean Nov 6, 2026
507a176
perf(agc): keep draws on a nearly full GPU heap by submitting early
Raghav314 Nov 6, 2026
77b55d6
refactor(agc): drop the GPU heap's kill switches for finished features
Raghav314 Nov 6, 2026
8cc6dc2
fix(agc): keep color target merges on the GPU heap
Raghav314 Nov 6, 2026
57108a0
test(agc): sample with constant samplers that share a pipeline identity
Raghav314 Nov 6, 2026
dfcd235
Merge main into the PR branch
oneandonlydean Nov 6, 2026
2415f03
refactor(agc): remove the per-draw fallback from GPU heap mode
Raghav314 Nov 6, 2026
c008d51
perf(agc): cut the per-draw cost of GPU heap mode
Raghav314 Nov 6, 2026
b181b63
test(agc): fix the AGC tests that fail with APS5_GPU_HEAP set
Raghav314 Nov 6, 2026
165df48
fix(agc): read dynamic-resolution variants from the stage's own image…
Raghav314 Nov 7, 2026
c07611f
perf(agc): write GPU heap data spans with sequential stores
Raghav314 Nov 7, 2026
b3faf28
perf(agc): hold the GPU heap span allocator for a whole stage write
Raghav314 Nov 7, 2026
27808af
perf(agc): let heap ring hits share their template's resource words
Raghav314 Nov 7, 2026
f4e7be1
perf(agc): write a heap stage's template descriptor run only when the…
Raghav314 Nov 7, 2026
9086da6
perf(agc): wake a full draw queue's producer at half depth, after a spin
Raghav314 Nov 7, 2026
bf35ef3
Merge main into the PR branch
Raghav314 Nov 7, 2026
e48ec7a
test(agc): build the heap stage words test and merged targets on Windows
Raghav314 Nov 7, 2026
a06a3bc
test(agc): give the nonuniform initial lifetime test's own recorder a…
Raghav314 Nov 7, 2026
78d2e5b
fix(agc): leave a heap stage whose walk cannot capture to the synchro…
Raghav314 Nov 7, 2026
67b971f
perf(agc): pass heap stages' guest buffer addresses in push data on N…
Raghav314 Nov 7, 2026
1334ab3
Merge main baf28a0a21 into perf/agc-vk-descriptor-heap
oneandonlydean Nov 7, 2026
1dc5567
Merge branch 'main'
oneandonlydean Nov 8, 2026
56ec7ed
fix(agc): keep the ring words pool in HostThreadLocal
oneandonlydean Nov 8, 2026
c0e88a6
Merge branch 'main'
oneandonlydean Nov 8, 2026
15c9133
fix(agc): size ElementFlags in the heap budget helpers
oneandonlydean Nov 8, 2026
7cf815c
perf(agc): read pushed guest buffers as storage and uniform buffers
Raghav314 Nov 8, 2026
a9728e4
fix(agc): bind guest buffers in place at the storage buffer alignment
Raghav314 Nov 8, 2026
18247ff
Merge branch 'main'
oneandonlydean Nov 8, 2026
10d2e59
test(agc): expect no recipe draws for relocated hits under entry veri…
oneandonlydean Nov 8, 2026
691ec49
Merge the pushed buffer commits into the PR branch
Raghav314 Nov 8, 2026
74293d5
Merge main into the PR branch
Raghav314 Nov 8, 2026
32dec13
refactor(agc): drop the heap's buffer descriptor ring path and its sw…
Raghav314 Nov 8, 2026
810824f
refactor(agc): drop the GPU heap's descriptor ring
Raghav314 Nov 8, 2026
94af8cb
style(agc): drop the comments added with the pushed buffers
Raghav314 Nov 8, 2026
d943ee9
fix(shader): move the disk cache format to 64
oneandonlydean Nov 8, 2026
9a8fd43
Merge main into the PR branch
Raghav314 Nov 8, 2026
b385f6b
perf(agc): lay out a GPU heap stage's bindings when its resources are…
Raghav314 Nov 8, 2026
0c27c51
perf(agc): carry GPU heap buffer addresses from where the buffers are…
Raghav314 Nov 8, 2026
358c8c3
Merge main into the PR branch
Raghav314 Nov 8, 2026
23da959
fix(agc): check a heap draw recipe's buffers for moves on every hit
Raghav314 Nov 8, 2026
219fb46
perf(agc): read a heap draw's moved buffer in place behind a pending …
Raghav314 Nov 8, 2026
9c788bb
perf(agc): trim per-draw bookkeeping on the heap draw paths
Raghav314 Nov 8, 2026
e62ad06
perf(agc): share a heap walk's read ranges between the memo and the draw
Raghav314 Nov 8, 2026
1957ec6
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 9, 2026
295b746
fix(agc): time the GPU heap's phases only under APS5_PIPELINE_STATS=2
Raghav314 Nov 9, 2026
c21bf27
perf(agc): key a heap ring stage's resource-cache entry from its ring…
Raghav314 Nov 9, 2026
cd6f534
perf(agc): share a heap walk memo hit's stage words instead of copyin…
Raghav314 Nov 9, 2026
113b692
perf(agc): relocate a heap draw's buffers without a rewritten descrip…
Raghav314 Nov 9, 2026
d98c075
perf(agc): keep a heap stage's data block when only pushed user data …
Raghav314 Nov 9, 2026
1981c56
perf(agc): drain the draw finisher on a lookup only for held draws th…
Raghav314 Nov 9, 2026
d0c6351
perf(agc): read a heap walk's tracker generation without the tracker …
Raghav314 Nov 9, 2026
6162dcb
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 9, 2026
ee7de12
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 9, 2026
f07da0c
fix(agc): do not share a ring stage's draw key when moved-buffer temp…
oneandonlydean Nov 9, 2026
f208a02
perf(agc): patch a relocated heap draw's ring words instead of copyin…
Raghav314 Nov 9, 2026
3fdda79
test(agc): skip the ring draw key reuse count under APS5_VERIFY_DRAW_…
Raghav314 Nov 9, 2026
36d3735
fix(agc): read a heap stage's flattened SRT guard words from its draw…
Raghav314 Nov 9, 2026
21d6bfb
perf(agc): inline Require and move its throw out of line
Raghav314 Nov 9, 2026
91decca
perf(agc): skip comparing a GPU heap stage's shader data when it has …
Raghav314 Nov 9, 2026
57066e7
perf(agc): evict the heap walk memo's least recently used keys
Raghav314 Nov 9, 2026
f7ca5e4
perf(agc): keep a GPU heap stage's slots in one compact per-stage record
Raghav314 Nov 9, 2026
dfdaa94
perf(agc): count why a moved buffer refuses an address-based template
Raghav314 Nov 10, 2026
0d4e6c6
perf(agc): key heap address-based templates on their buffers' view al…
Raghav314 Nov 10, 2026
4c2a741
perf(agc): read heap stages' user data from a per-draw block
Raghav314 Nov 10, 2026
9cb1ce6
Merge main into the PR branch
Raghav314 Nov 10, 2026
7fc3528
Merge main into the PR branch
Raghav314 Nov 10, 2026
3f20fdd
fix(recompiler): validate uniform constant buffers under uniformBuffe…
oneandonlydean Nov 10, 2026
618b9df
test(agc): run the heap walk memo on two threads under eviction pressure
Raghav314 Nov 10, 2026
6ae84cb
Merge main into the PR branch
Raghav314 Nov 10, 2026
7e523e8
Merge main into the PR branch
Raghav314 Nov 11, 2026
8888d4d
test(agc): give main's color write mask and copy input lifetime tests…
Raghav314 Nov 11, 2026
681015d
perf(agc): skip the heap walk memo for shaders whose lookups do not hit
Raghav314 Nov 10, 2026
d5ed08b
perf(agc): recycle a heap walk's stage words, values and ranges
Raghav314 Nov 10, 2026
23eeaf7
perf(agc): encode a stage's constant pushed buffer records once and c…
Raghav314 Nov 10, 2026
af655a4
perf(recompiler): look up a heap template through a per-thread front …
Raghav314 Nov 10, 2026
ec18bbb
perf(agc): build a heap walk's read ranges as it reads instead of sor…
Raghav314 Nov 11, 2026
847fe14
feat(agc): count why recorded dispatches get no recipe
Raghav314 Nov 12, 2026
5204b8a
perf(agc): queue pipelined dispatches and sample dumps behind the fin…
Raghav314 Nov 12, 2026
a934a5e
perf(recompiler): fill a heap stage's per-draw binding words without …
Raghav314 Nov 12, 2026
db48d57
fix(recompiler): keep a specialized module's words once a result need…
Raghav314 Nov 12, 2026
7035a25
perf(agc): keep heap stage tables across draws and drop heap caches t…
Raghav314 Nov 12, 2026
b03e0d1
Merge remote-tracking branch 'origin/main' into perf/heap-drain-cuts
Raghav314 Nov 12, 2026
b5b0bff
fix(agc): rebuild a heap stage's image table map after a rebuild that…
Raghav314 Nov 12, 2026
c02c8e4
docs(agc): list APS5_HEAP_NO_CACHE and drop the deleted walk memo budget
Raghav314 Nov 12, 2026
184749b
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 13, 2026
ff359f8
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 13, 2026
1a7d1b7
test(agc): recompile the float rounding test's store for the device's…
Raghav314 Nov 13, 2026
1bedba2
perf(agc): copy heap push data in runs and keep only a draw's own buf…
Raghav314 Nov 13, 2026
0433c01
perf(agc): look up a heap draw's buffer address overrides by binary s…
Raghav314 Nov 13, 2026
93a0e7c
perf(agc): keep a depth surface's plane sizes instead of recomputing …
Raghav314 Nov 13, 2026
c9a4ea4
perf(agc): find the pending storage images that overlap a range throu…
Raghav314 Nov 13, 2026
6d6465d
perf(agc): set a storage image's pending-since generation in one fill…
Raghav314 Nov 13, 2026
bbffef5
perf(agc): let a storage refresh keep its proof when another pending …
Raghav314 Nov 13, 2026
56033b9
perf(agc): keep the pending range index sorted as images join and lea…
Raghav314 Nov 13, 2026
bdd18b9
perf(agc): answer a pending-image overlap check without the lock when…
Raghav314 Nov 13, 2026
bf28d72
perf(agc): walk only the pending images a label readback can store
Raghav314 Nov 13, 2026
b92b489
perf(agc): reuse a heap stage's user block when its inputs did not ch…
Raghav314 Nov 13, 2026
bcd73c1
fix(agc): draw the FSR upscaler through the descriptor heap in heap mode
Raghav314 Nov 13, 2026
fd6cf2c
fix(agc): write shader request dumps for heap draw stages
Raghav314 Nov 13, 2026
b635a72
test(agc): check relocated ring-hit verification only when draw entri…
Raghav314 Nov 13, 2026
2a40091
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 13, 2026
7a3eecf
perf(agc): publish the pending ranges when an overlap check takes the…
Raghav314 Nov 13, 2026
28ff546
test(agc): link the pending range index test against libc
Raghav314 Nov 13, 2026
c1c98c1
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 13, 2026
8f863c7
perf(agc): push only the changed range of a heap draw's push data
Raghav314 Nov 13, 2026
3cd415a
perf(agc): size a heap template's content key by the words it holds
Raghav314 Nov 13, 2026
b02157c
fix(agc): link the push data shadow test as a host test on MinGW
Raghav314 Nov 14, 2026
88c5954
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
b0f5a07
fix(agc): key described pipeline identities on embedded samplers
Raghav314 Nov 14, 2026
5ce09a8
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
93fc1f9
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
e1cdfe2
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
7addd04
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
5c4aa17
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
72f1ed7
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 14, 2026
11aa978
test(agc): keep prepared shader results alive while comparing their m…
Raghav314 Nov 14, 2026
3f2a9e5
perf(shader): compute a result's pipeline identity once instead of pe…
Raghav314 Nov 14, 2026
96828be
perf(agc): skip a dispatch variant's pending image check while the pe…
Raghav314 Nov 14, 2026
1ebbeac
perf(agc): reuse the queue worker's vertex stage decode on heap ring …
Raghav314 Nov 14, 2026
ecdf20e
perf(agc): fill a heap stage's walk ranges and values in recycled buf…
Raghav314 Nov 14, 2026
b43aa48
perf(agc): trust a range the heap walk already proved accessible for …
Raghav314 Nov 14, 2026
50b6bf7
perf(agc): look up a written buffer binding's words once per binding
Raghav314 Nov 14, 2026
9dfd5db
perf(agc): read a stage's walked user data from its capture instead o…
Raghav314 Nov 14, 2026
a68cf39
perf(agc): test queued draw writes against the reads' hull before eac…
Raghav314 Nov 14, 2026
9cb6530
perf(shader): define AddSignedAddress inline in its header
Raghav314 Nov 14, 2026
e31fd4b
perf(agc): read a heap stage's flattened SRT from its words instead o…
Raghav314 Nov 14, 2026
39754a0
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 15, 2026
a80c51f
fix(agc): keep main's moved buffer fields ahead of the heap's in-plac…
Raghav314 Nov 15, 2026
84b925e
fix(agc): bind the changed-copy pass through the heap-aware push wrap…
Raghav314 Nov 15, 2026
6751c95
fix(agc): fall back to the classic CMASK clear when its heap pipeline…
Raghav314 Nov 15, 2026
067ae73
test(agc): sample the mirrored embedded sampler and reject a bench wi…
Raghav314 Nov 15, 2026
46e1efc
refactor(agc): trim the GPU heap's dead APIs, duplicate counters and …
Raghav314 Nov 15, 2026
17e902f
refactor(agc): split the heap stage writers and share the heap elemen…
Raghav314 Nov 15, 2026
ee25c5c
refactor(agc): share the heap ring, finisher and presentation paths a…
Raghav314 Nov 15, 2026
1a651ae
refactor(shader): split push data placement and pushed buffer definit…
Raghav314 Nov 15, 2026
7b9806d
perf(agc): restore the per-thread heap stage fit cache keyed by variant
Raghav314 Nov 15, 2026
91cf658
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 15, 2026
4d967da
fix(agc): name the changed-copy bind site in the GPU heap report
Raghav314 Nov 15, 2026
c7ec10a
perf(agc): read heap SRT and buffer overflow records through mapped u…
Raghav314 Nov 15, 2026
c42be1f
perf(agc): read heap walk table ranges in bulk
Raghav314 Nov 15, 2026
f81c5f2
perf(agc): reuse unwritten image tables in the heap stage walk
Raghav314 Nov 15, 2026
fafb239
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 15, 2026
857fa7c
fix(agc): hash main's shader snapshot key with the snapshot hash scope
Raghav314 Nov 15, 2026
c681e7d
perf(agc): build new heap stage templates off the draw thread with AP…
Raghav314 Nov 15, 2026
d3d885a
fix(agc): decline a heap walk over a pending table before flushing it
Raghav314 Nov 15, 2026
d41fa15
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 15, 2026
46454e1
test(agc): check main's push budget boundaries on the per-draw graphi…
Raghav314 Nov 15, 2026
d259fc1
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 15, 2026
dfad9e5
fix(shader): validate a moved prepared request's inputs as a copied o…
Raghav314 Nov 15, 2026
e65cf02
fix(agc): create split compute pipelines through the descriptor heap
Raghav314 Nov 15, 2026
fcb1a45
test(agc): skip the refresh proof test where it cannot run
Raghav314 Nov 15, 2026
050c541
test(agc): define NOMINMAX before windows.h in the heap tests
Raghav314 Nov 15, 2026
d6dbd5c
chore(agc): drop three added code comments and a trailing blank line
Raghav314 Nov 15, 2026
219aca8
refactor(shader): leave image table bindings out of the dropped bindi…
Raghav314 Nov 15, 2026
7938e1a
fix(agc): read APS5_GPU_HEAP=0 as off and reject malformed heap settings
Raghav314 Nov 15, 2026
0408022
fix(agc): scan classic programs' SPIR-V for stores through addresses …
Raghav314 Nov 15, 2026
80e7d90
fix(agc): request device addresses for the heap CMASK error buffer it…
Raghav314 Nov 15, 2026
61b508c
fix(agc): decline misaligned heap walk reads and reset stale stage views
Raghav314 Nov 15, 2026
2ddef16
fix(agc): tag heap retirements only after the submit succeeds
Raghav314 Nov 15, 2026
e864666
fix(agc): lock the pipeline cache when creating heap stage pipelines
Raghav314 Nov 15, 2026
df1b504
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 16, 2026
b65ae79
fix(agc): keep heap stage reads and queued writes consistent on the d…
Raghav314 Nov 16, 2026
875ebe8
fix(agc): cover uniform reads in dispatch barrier elision and skip he…
Raghav314 Nov 16, 2026
882d2c3
fix(agc): key descriptor heap object hooks and records by device
Raghav314 Nov 16, 2026
2ece7ff
fix(agc): validate the heap timeline before submitting and keep the b…
Raghav314 Nov 16, 2026
3c0b9b8
fix(agc): shader resource build cleanup, array views, and plane track…
Raghav314 Nov 16, 2026
a97ba5d
fix(shader): heap slot words, plan reads, optional user data and temp…
Raghav314 Nov 16, 2026
cf8a7b0
test(agc): fix review findings on heap, recorder and finisher tests
Raghav314 Nov 16, 2026
4b6c7b2
docs(agc): heap mode has no per-draw fallback
Raghav314 Nov 16, 2026
464e176
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 16, 2026
bb79628
test(agc): cover a heap in-place moved buffer read behind a queued la…
Raghav314 Nov 16, 2026
3196e68
fix(agc): keep driver caches and heap stage preparation consistent
Raghav314 Nov 17, 2026
40aacd6
fix(agc): return bindless heap slots on failure and track their recorder
Raghav314 Nov 17, 2026
2617675
fix(agc): keep heap draw resources consistent across stages
Raghav314 Nov 17, 2026
dab8ac6
fix(agc): reject a heap limit hidden by a later option in shader replay
Raghav314 Nov 17, 2026
8ace110
fix(shader): fail sampler heap emission when dynamic indexing is unav…
Raghav314 Nov 17, 2026
d8feba7
test(agc): keep image table cache bounds registrations in their own f…
Raghav314 Nov 17, 2026
5b92ffd
docs(user): say a GPU heap stage that cannot be mapped fails
Raghav314 Nov 17, 2026
86f9fbc
test(agc): fix review-2 test findings for the GPU heap tests
Raghav314 Nov 17, 2026
0a6844d
Merge main into perf/agc-vk-descriptor-heap
Raghav314 Nov 17, 2026
6127b8d
fix(agc): expect a verified relocated hit to be captured again in the…
Raghav314 Nov 17, 2026
7d4214c
test(agc): do not require a finisher restart for a relocated draw ver…
Raghav314 Nov 17, 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 @@ -228,6 +228,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
60 changes: 51 additions & 9 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 @@ -376,6 +399,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 @@ -458,6 +482,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 @@ -488,6 +513,7 @@ 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
${agcTextureDetileShaderHeader}
${agcReadbackHeaders}
${agcMultisampleUploadHeader}
Expand All @@ -497,6 +523,8 @@ set(agcDriverSources
${agcStagingCopyBackShaderHeader}
${agcTextureDetileImageShaderHeader}
${agcTextureRepackShaderHeader}
${agcTextureDetileAddressedShaderHeader}
${agcTextureRepackAddressedShaderHeader}
${agcDispatchArgumentsShaderHeader}
${agcTextureDetileWordsShaderHeader}
${agcTextureDetileImageWordsShaderHeader}
Expand Down Expand Up @@ -756,19 +784,33 @@ 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}")
if(WIN32)
set_tests_properties(${agcTestName}_draw_pipeline PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
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()
add_test(NAME ${agcTestName}_plan_verify COMMAND ${agcTestName}_tests)
set_tests_properties(${agcTestName}_plan_verify PROPERTIES ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1;APS5_DRAW_PIPELINE=1;APS5_PIPELINED_DRAWS=32;APS5_PIPELINE_DISPATCH=1;APS5_VERIFY_DRAW_PLAN=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
if(WIN32)
set_tests_properties(${agcTestName}_plan_verify 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)
agc_add_env_test(${agcTestName}_plan_verify ${agcTestName}_tests
ENV ANYPS5_NO_SHADER_CACHE=1 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_VERIFY_DRAW_PLAN=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 @@ -1116,7 +1158,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(_undecodable_module)?|agc_pipeline_store_replay_growth|agc_pipeline_journal_replay_priority)$")
list(FILTER agcRegisteredTests EXCLUDE REGEX "^(agc_pipeline_journal(_long_paths|_extended_paths)?|agc_driver_pipeline_journal(_undecodable_module|_gpu_heap)?|agc_pipeline_store_replay_growth|agc_pipeline_journal_replay_priority)$")
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 @@ -75,11 +75,15 @@ 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::vector<std::array<std::uint32_t, 3>> ringDescriptorPatches;
std::vector<std::pair<std::uint32_t, std::uint32_t>> ringDataPatches;

std::shared_ptr<ShaderMemory> memory;
std::vector<ShaderRecompiler::MemoryRegion> captured;
std::vector<std::pair<std::uint64_t, std::size_t>> spans;
std::atomic<std::uint64_t> generation{0};
mutable std::atomic<std::uint64_t> cleanPendingSerial{~0ull};
};

struct DispatchEntry {
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 @@ -123,6 +124,8 @@ class DrawKeySightings {

enum class DrawVerdict { Drawn, Nothing, Rejected };

enum class StageOrigin { Captured, HeapUnread, HeapRead };

struct StageCapture {
std::shared_ptr<const ShaderRecompiler::RecompileResult> compiled;
std::shared_ptr<const ShaderRecompiler::ResourceCapture> capture;
Expand All @@ -131,8 +134,15 @@ struct StageCapture {
std::vector<std::shared_ptr<const ShaderRecompiler::SrtGuestWords>> supplied;
std::uint64_t forgetSerial = 0;
std::uint32_t pushOffset = 0;
ShaderRecompiler::SrtUserDataUse userDataUse;
std::uint64_t userDataMask = ~std::uint64_t{0};
StageOrigin origin = StageOrigin::Captured;
std::shared_ptr<ShaderRecompiler::HeapStageWords> heapWords;
std::shared_ptr<const std::vector<std::uint32_t>> heapReadWords;

const ShaderRecompiler::SrtUserDataUse& UserDataUse() const;

bool Cacheable() const { return origin != StageOrigin::HeapUnread; }
bool Direct() const { return origin != StageOrigin::Captured; }
};

struct RelocatableUserWord {
Expand Down Expand Up @@ -163,7 +173,7 @@ struct DrawRelocationTrial {
};

struct DrawRelocationCounters {
std::uint64_t lookups = 0, donors = 0, refused = 0, hits = 0, evicted = 0;
std::uint64_t lookups = 0, donors = 0, refused = 0, hits = 0, evicted = 0, admitted = 0;
};

bool DecodeProgramsCurrent(const DrawDecode& decode, const ShaderRegistry& registry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class DrawPipeline {
static std::uint64_t DrainRequestsByOpcode(std::uint32_t opcode);
static std::uint64_t DrainRequestsByReason(DrainReason reason);
bool Busy() const;
std::uint32_t FullWaiters();
std::size_t Outstanding() const { return outstanding.load(std::memory_order_acquire); }
bool Overlaps(std::uint64_t address, std::size_t bytes);
bool OverlapsAny(std::span<const std::pair<std::uint64_t, std::uint64_t>> ranges);
Expand Down Expand Up @@ -98,6 +99,7 @@ class DrawPipeline {
std::atomic<std::uint64_t> decodeDrains{0};
std::uint64_t reportedDecodeDrains = 0;
std::uint32_t idleWaiters = 0;
std::uint32_t fullWaiters = 0;
std::size_t resumeAt = 0;
bool committerWaiting = false;
bool stopped = false;
Expand Down Expand Up @@ -139,7 +141,7 @@ class DrawFinisher {
LabelLookup PendingLabel(std::uint64_t address, std::size_t bytes, std::uint64_t& value);
bool PendingOverlapsAny(std::span<const Range> ranges);
bool PendingKey(std::uint64_t key, std::uint64_t shape);
enum class DrainSite : std::uint32_t { Lookup, Reads, Packet, Kept, Count };
enum class DrainSite : std::uint32_t { Lookup, Reads, Packet, Kept, Dispatch, Count };
static void NoteDrain(DrainSite site, bool drained);
static std::string DrainText();
static void NoteDrainedOpcode(std::uint32_t opcode, bool besideCommits);
Expand All @@ -149,6 +151,7 @@ class DrawFinisher {
static bool Busy() { return outstanding.load(std::memory_order_acquire) != 0; }
void Enqueue(Job job);
void Enqueue(Job job, Pending held);
void EnqueueBeside(Job job, std::vector<Range> writes, std::uint64_t labelAddress = 0, std::vector<std::byte> labelBytes = {});
void Drain();
void Settle();
void ReleaseRan();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#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::DriverDetail {

struct DispatchVariant;

bool HeapStageExcluded(ShaderRecompiler::ShaderStage stage);
bool HeapPreRasterStage(ShaderRecompiler::ShaderStage stage);
const char* HeapStageIneligibility(ShaderRecompiler::ShaderStage stage, const ShaderRecompiler::IrResourcePlan* plan);
bool HeapStageEligible(ShaderRecompiler::ShaderStage stage, const ShaderRecompiler::IrResourcePlan* plan);
bool HeapExcludedFor(const ShaderRecompiler::PreparedShaderInvocation& invocation);
bool HeapClassesExcluded();
void RequireHeapStageMappable(const ShaderRecompiler::RecompileResult& result, bool workgroupAddress = false);
bool HeapStageFits(const ShaderRecompiler::RecompileResult& result, bool workgroupAddress = false);

bool SampleHeapStageVerify();

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

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

void ResetHeapStageWords(ShaderRecompiler::HeapStageWords& words);

void AppendWalkRead(std::vector<std::pair<std::uint64_t, std::uint64_t>>& runs, std::uint64_t address);

void CoalesceWalkReads(std::vector<std::pair<std::uint64_t, std::uint64_t>>& runs, std::vector<std::pair<std::uint64_t, std::uint64_t>>& ranges);

HeapStageMaterialized MaterializeHeapStage(const ShaderRecompiler::PreparedShaderInvocation& invocation, std::span<const std::uint32_t> userData,
ShaderRecompiler::MemoryRegionView memory, 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 NextHeapDataOrigin();
std::uint64_t HeapRingHitsVerified();
std::uint64_t HeapRingHitsDiffering();
std::shared_ptr<const ShaderRecompiler::RecompileResult> PatchedHeapResult(const ShaderRecompiler::RecompileResult& shared,
const ShaderRecompiler::HeapStageWords& words);
void BuildRingWords(const DispatchVariant& variant, std::span<const std::uint32_t> user, const std::vector<std::uint32_t>* refreshedData, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#ifndef CORE_LIBS_PRX_LIBSCEAGCDRIVER_EXECUTION_INCLUDE_DRIVER_DRAW_RECYCLEDSHARED_HPP
#define CORE_LIBS_PRX_LIBSCEAGCDRIVER_EXECUTION_INCLUDE_DRIVER_DRAW_RECYCLEDSHARED_HPP

#include <atomic>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <vector>

namespace AgcDriver::DriverDetail {

template <typename TObject>
class RecycledShared {
public:
RecycledShared(std::size_t capacity, std::size_t probes) : capacity(capacity), probes(probes) {}

template <typename TReset>
std::shared_ptr<TObject> Take(TReset&& reset) {
for (std::size_t probe = 0; probe < probes && probe < pool.size(); ++probe) {
auto& candidate = pool[cursor];
advance();
if (candidate.use_count() != 1) continue;
std::atomic_thread_fence(std::memory_order_acquire);
reset(*candidate);
++reused;
return candidate;
}
auto made = std::make_shared<TObject>();
++fresh;
if (pool.size() < capacity) {
pool.push_back(made);
} else if (!pool.empty()) {
pool[cursor] = made;
advance();
}
return made;
}

std::uint64_t Reused() const {
return reused;
}

std::uint64_t Fresh() const {
return fresh;
}

private:
void advance() {
cursor = cursor + 1 >= pool.size() ? 0 : cursor + 1;
}

std::vector<std::shared_ptr<TObject>> pool;
std::size_t cursor = 0;
std::size_t capacity;
std::size_t probes;
std::uint64_t reused = 0;
std::uint64_t fresh = 0;
};

}

#endif
Loading
Loading