Commit Graph
20 Commits
Author SHA1 Message Date
TamaleroandClaude Opus 5.5 97a84e3261 fix(recompiler): hold 32 samplers in the runtime sampler heap
A pixel shader of PPSA16833 binds more than 16 samplers outside the
sampler tables. Each takes two heap entries, one per descriptor variant,
so the 32-entry heap refused it with "shader sampler pairs exceed runtime
heap capacity" and the title aborted when a new game started.

The heap now holds 64 entries (32 samplers). Its metadata array is part
of ShaderData, which grows from 14528 to 16064 bytes, still within the
16 KiB uniform buffer every Vulkan device supports; the runtime ABI
version moves to 13 so shaders cached with the old layout are rebuilt.
The overflow message names the sampler count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:36:17 +13:00
Dean 29bfe31dd8 Merge pull request #6083 from n-delic/pr/sampler-pairs-v2
fix(shader): allow 32 sampler pairs per shader
2026-10-17 16:34:56 +13:00
MarcZX100 3dca09e194 fix(agc): validate geometry shader capability 2026-10-16 17:22:42 +00:00
MarcZX100 8a82811d9b fix(agc): preserve draw parameter profile validation
Restore the shaderDrawParameters feature guard while adding shaderTerminateInvocation support. Cover enabled and disabled DrawParameters profiles, and pass the termination feature to the correct shader validation argument.
2026-10-16 13:10:28 +02:00
MarcZX100 502a972f2d test(agc): update terminate checks for current APIs 2026-10-16 13:10:28 +02:00
abnergtz 54e95dfa76 feat(agc): enable VK_KHR_shader_terminate_invocation on the device
The device queries and enables shaderTerminateInvocation when available, advertises SPV_KHR_terminate_invocation to the recompiler and validation, and the shader device profile rejects a target that advertises the extension without the enabled feature.

Based on the approach in poonasor/AnyPS5@73969879.

Refs #2009

(cherry picked from commit 1866a3f70e7ac1c34c8cd87fc79a973bd9ba6947)
2026-10-16 13:10:28 +02:00
abnergtz 0fe8527a0a test(agc): cover terminate invocation specialization, stage boundaries and disabled feature 2026-10-16 13:10:28 +02:00
Nahid DelicandClaude Opus 5.5 f7b2ebd8b4 fix(shader): allow 32 sampler pairs per shader
A pixel shader of MXGP 26 (PPSA30839) uses 17 samplers, over the limit
of 16 sampler pairs. The sampler heap now holds 64 descriptors, ShaderData
grows by 32 sampler metadata records and the runtime ABI version moves
to 13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 23:29:15 +02:00
Celegans12 d9e47d1e98 feat(agc): implement image and sampler tables indexed at runtime offsets
Materialize runtime-indexed image and sampler records into descriptor
tables while keeping descriptor selection in the shader. Report invalid
active entries through the existing deferred fault buffer.

Bind fragment tables in the fragment set when pipeline libraries split it,
and reserve a physical descriptor for empty tables. Reject unsupported
sampler, border, cube and anisotropic pairings per entry. Keep one column
per heap access shape, one T# shared by several image operations included
(milescoviello's #5550 case), and narrow it to the union of its keys'
domains when every key has one (SleglJan's key-domain changes). Plan
columns read at (key << n) & mask over their whole domain (tibzejoker's
fix). Read records in runs through SleglJan's bulk reader, and reject
entries whose surface has no mapped byte, as Tamalero proposed. Store
table columns in disk plans; update the runtime ABI and disk format. Bound
table-sized entries in the resource cache (65,536 table elements) and the
dispatch cache (256 MiB of captured words), evicting LRU.
2026-10-14 16:43:57 +02:00
Arvind FrøilandandClaude Opus 5.5 7216621545 fix(agc): typed image heaps on devices without nullDescriptor
The typed descriptor heaps write a null descriptor for a null guest
image, and the device therefore required VK_EXT_robustness2's
nullDescriptor. MoltenVK has the extension but not the feature, so on
macOS no Vulkan device opened and every GPU test was skipped. The
feature is now enabled when the device has it. Without it, the device
creates a placeholder image per typed image heap: 1x1, cleared to zero,
of the heap's dimension, sample count, numeric class and access, and a
null guest image binds the placeholder of its heap. A heap whose
placeholder the device cannot create throws when a null image reaches
it. TechnicalDebt.md lists where a placeholder differs from a null
descriptor.

agc_placeholder_images checks every image resource the recompiler maps
to a heap against that heap's placeholder, so the two cannot drift
apart, and agc_shader_device_profile now expects a device without
nullDescriptor to be accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 10:32:49 +02:00
Alex ColliniandClaude Opus 5.5 381d5b37b7 fix(recompiler): hold 64 images in a sampled image heap
A shader reported in review binds 40 sampled images of one class, more
than 32. The cap only bounds the compact heap arrays, so no layout or
ABI version changes. The test covers 40 images and a full class through
the constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 10:09:43 +02:00
Alex ColliniandClaude Opus 5.5 ea22c8286d fix(recompiler): hold 32 images in a sampled image heap
A compute program of PPSA26344 binds 29 sampled images of one class, more
than the 16 a typed sampled heap held, and failed with "shader image heap
capacity exceeded". Heap arrays are declared with their compact length,
so shaders that fitted before keep their layout and SPIR-V.

Bindless image tables keep 16 slots: they were sized by the same constant,
and each slot costs an image entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 10:09:42 +02:00
MathiasDevelopesandClaude Sonnet 5.5 83e0a01540 fix(recompiler): size a typed storage heap for several images, not one dynamic image
A typed storage-image heap held four elements, and a dynamic-mip storage
image takes four of them for its mip slots. A shader with a dynamic-mip
storage image and any other storage image of the same class needed five
and failed with "shader image heap capacity exceeded". The mip slots
per dynamic image stay four (StorageMipSlots); a storage heap now holds
sixteen elements (StorageHeapCapacity). Heap arrays are declared with
their compact length, so shaders that fitted before are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 08:40:41 +02:00
authurtabo-byte 9c292fd939 fix(shader): reserve heap space for sixteen sampler pairs 2026-10-09 15:40:51 -07:00
boykopovar 1f8a7e0b94 test(shader): align specialization checks with runtime abi 2026-10-08 17:37:37 +03:00
boykopovar 05fa426112 perf(shader): eliminate prepared-path overhead in data, descriptors, dispatch, bda 2026-10-08 17:29:17 +03:00
boykopovar 3e47c30ed7 fix(shader): handle repeated registers and prepare msaa storage shaders 2026-10-08 17:27:28 +03:00
boykopovar 1174069239 feat(shader): select image and sampler resources at runtime 2026-10-08 17:26:34 +03:00
boykopovar dccfa08de9 feat(shader): add fixed runtime abi + typed descriptor heaps 2026-10-08 17:26:04 +03:00
boykopovar 27439c43cc feat(shader): version runtime abi + freeze device capabilities 2026-10-08 17:26:01 +03:00