Commit Graph
2489 Commits
Author SHA1 Message Date
Dean de8642d289 Merge pull request #15793 from root-over/fix/shader-both-pair-pixel-input-barycentrics
fix(shader): fall back to barycentrics for a pixel input read through both I/J pairs
2026-11-05 21:24:26 +13:00
Dean 2238042b81 Merge pull request #15705 from oneandonlydean/rr/pr3-gpu
feat(run-report): count milestones, frames, GPU and shader diagnostics
2026-11-05 21:24:14 +13:00
Dean ba6d0db88c Merge pull request #9198 from milescoviello/perf/validate-dominator-tree
perf(shader): validate value IR dominance with a dominator tree
2026-11-05 16:59:22 +13:00
Dean 288f44f556 Merge pull request #15741 from zorde23/fix/agc-fragment-uint-storage-views
fix(agc): bind UINT views for float16 stores outside compute shaders
2026-11-05 08:21:16 +13:00
Dean 296b1ac934 Merge pull request #15795 from Pipodi/perf/shader-fault-check-dedup
perf(shader): skip fault checks dominated by the same check
2026-11-05 08:18:59 +13:00
Dean 4cc524698e Merge pull request #15718 from Nesyth/perf/shader-f16-fma-khr-scalar
perf(shader): compute v_fma_f16, v_fmac_f16, v_fmamk_f16 and v_fmaak_f16 with OpFmaKHR
2026-11-05 08:18:50 +13:00
Dean 836e1a5894 Merge pull request #15655 from XatiX/perf/shader-table-stamp-read-pages
perf(shader): reuse an unwritten image table snapshot read through a pointer
2026-11-05 08:18:37 +13:00
Dean 4ba1a7090e Merge pull request #14971 from JJenkx/fix/agc-fuse-front-constant-buffer
fix(agc): keep a front half's embedded constant buffer when fusing geometry halves
2026-11-05 08:18:26 +13:00
Dean 020377bf9b Merge pull request #14265 from Astronaut10/perf/shader-vertex-specialized
perf(shader): emit vertex modules specialized instead of in registration form
2026-11-05 08:18:17 +13:00
Dean f8a6fb14fb Merge pull request #8458 from TheSovietWaffle/test/shader-mul-lo-u16-negated
fix(shader): keep 24-bit factor reads that a negating xor feeds into a multiply
2026-11-05 06:34:07 +13:00
Giuseppe Magliano 31317e522b fix(shader): fall back to barycentrics for a pixel input read through both I/J pairs
A pixel shader can interpolate one parameter through a perspective pair for
some components and a linear pair for others. Genesis Plus GX (PPSA99921)
reads attribute 0's x and y through one pair and its z through the other in
the shader behind its menu. Host interpolation gives each input a single
Vulkan interpolation, so it cannot express that, but HostInterpolationChecker
asked InputIsLinear, which throws for such an input, and the title stopped at
"pixel input 0 is interpolated through both a perspective and a linear I/J
pair" instead of taking the barycentric path.

HostInterpolationChecker::Lower now declines when an input is in both the
linear and perspective masks, so Recompile translates the shader again with
barycentrics, which interpolate every v_interp through the pair it reads.
agc_shader_memory now requires that fallback, with both barycentrics, for the
two-pair case it used to expect to fail.
2026-11-04 16:31:30 +01:00
Alex ColliniandClaude Opus 5.5 6aee0ff2a4 perf(shader): skip fault checks dominated by the same check
An invalid-descriptor fault check of a GPU-descriptor buffer access, and the
swizzle-selector check of a formatted load, is not emitted when an identical
check on the same descriptor under the same execution guard sits earlier in
the same IR block or in a dominating block. The fault record, the invocation
stop and the host error stay the same; only the pc stored for a fault that two
invocations race to record can differ. APS5_NO_FAULT_CHECK_DEDUP restores every
check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 15:00:27 +01:00
Dean Galvin e79ea36180 fix(run-report): keep the counted shader failure in HostThreadLocal; check the host CPU as a report
NoteFailureOnce kept the last counted exception in a thread_local
std::exception_ptr. In a prx on Windows its destructor runs after emulated
TLS freed the object, which prx_thread_local_destructors refuses. Keep it in
HostThreadLocal like the recompiler's other per-thread state.

host-probe checked the raw CPU name with SafeText, which rejects '@', so it
failed on CPUs whose name ends in a clock ("... CPU @ 2.10GHz") although the
report keeps the name with the clock cut. Check it through the report.

NotImplemented_nid_no_patch now expands to NotImplementedAt_nid_no_patch, so
emscripten_module_unwind_tests, which does not link libc, also stubs the
located entry point.
2026-11-05 00:14:07 +13:00
zorde23andClaude Opus 5.5 afb1ab39bd build(shader_recompiler): list UintStorageImageBinding as reviewed for the shader cache key
It only picks the host view for a binding number and does not change
what a recompile produces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VAPyfZR5GPZaWxRz67e9FT
2026-11-04 09:10:58 +00:00
Nesyth 476df725ba perf(shader): compute v_fma_f16, v_fmac_f16, v_fmamk_f16 and v_fmaak_f16 with OpFmaKHR 2026-11-04 09:57:06 +01:00
Dean a9a6ae8ad6 Merge pull request #14627 from AlexWhitehouse/feat/shader-f64-clamp-keeps-nan
feat(shader): keep NaN through f64 result clamp when DX10_CLAMP is clear
2026-11-04 21:32:18 +13:00
Dean 4d78c21efe Merge pull request #14850 from Filip722/perf/scalar-dword-limit-20261101
perf(shader): compare scalar buffer bounds as capped dword counts
2026-11-04 21:31:25 +13:00
zorde23andClaude Opus 5.5 1886f850bb fix(agc): bind UINT views for float16 stores outside compute shaders
The UINT storage view for float16 image stores was chosen only when the
global binding number fell in the uint storage image slots of the main
stage. Binding numbers are stage * Binding::Count + slot, so a pixel,
hull or domain shader's slots never matched: its uint writes went to a
float16 view and the store was lost on AMD's Windows driver. The slot is
now taken from the binding number within its stage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VAPyfZR5GPZaWxRz67e9FT
2026-11-04 08:22:25 +00:00
Dean Galvin 0003ec72c7 Merge rr/pr2-writer into rr/pr3-gpu 2026-11-04 20:21:16 +13:00
Dean e14a0da086 Merge pull request #12125 from Oscar45397/fix/libSceAgcDriver-mesh-fan-restart
fix(agc): honour primitive restart in mesh-path triangle fans
2026-11-04 18:34:03 +13:00
Dean 32ba394b1e Merge pull request #11265 from tibzejoker/perf/f16-fma-khr
perf(shader): compute v_pk_fma_f16 and v_pk_fmac_f16 with OpFmaKHR
2026-11-04 17:48:25 +13:00
Dean 5efe8f6520 Merge pull request #7223 from yabanana/feature/nested-resource-tables
feat(shader): resolve nested image tables through runtime pointers
2026-11-04 16:57:51 +13:00
XatiXandClaude Opus 5.5 05584f417d perf(shader): reuse an unwritten image table snapshot read through a pointer
An image table column's snapshot could not be reused unwritten when the
column is addressed through a pointer, or when the capture had already
read pages of the table before taking its write stamp: the column took
no stamp, or stampWrites refused it, so every capture compared the whole
table again. A pointer-addressed column now stamps its remembered read
range before the compare. With an explicit span query, stampWrites keeps
a stamp over pages the capture already read when they still match
memory after the collect; without one it refuses as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 23:54:00 +00:00
Dean 04a9eb4fa2 Merge pull request #15465 from mrfelek/fix/snapshot-allocation-churn
fix(agc): accept a resource snapshot when only unrelated allocations moved
2026-11-04 10:08:59 +13:00
Dean Galvin 218fd5a231 Merge commit '086c0686c8adff3ee648fdbe34e0b0b647e1d511' into HEAD
# Conflicts:
#	core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp
2026-11-04 08:19:34 +13:00
Dean 2fde02c401 Merge pull request #15362 from beardsciences/perf/mesh-window-no-zero-fill
perf(shader): stop zeroing mesh window buffer slots at workgroup start
2026-11-04 08:13:10 +13:00
Dean 6eb5665c38 Merge pull request #15287 from AlexWhitehouse/feat/shader-sdwa-int-to-f32-destinations
feat(shader): accept SDWA destination selects on v_cvt_f32_i32 and v_cvt_f32_u32
2026-11-04 08:12:34 +13:00
Dean 80400656a1 Merge pull request #15282 from LeandroLP23/refactor/shader-remove-unused-helpers
refactor(shader): remove the unused SharedMemoryBarrierInserter and ShaderStageRuntime
2026-11-04 08:12:28 +13:00
Dean 6cd2899cc6 Merge pull request #15244 from AlexWhitehouse/feat/shader-sdwa-integer-bitscan-destinations
feat(shader): accept SDWA destination selects on integer bit scans and bfrev
2026-11-04 08:11:55 +13:00
Dean b11031f512 Merge pull request #15155 from Pipodi/perf/spanned-ballot-one-barrier
perf(shader): build a spanned wave's ballot from the native subgroup ballot
2026-11-04 08:11:28 +13:00
Dean e2b29c8047 Merge pull request #14880 from Gonic0/perf/agc-scalar-guard-aligned
perf(shader): check only the carry on scalar buffer reads bound to their exact range
2026-11-04 08:11:15 +13:00
Dean c915f22fd8 Merge pull request #14866 from milescoviello/fix/bda-stop-lane-reads
fix(shader): keep pixel invocations running after a BDA fault in a program that reads lanes by index
2026-11-04 08:11:05 +13:00
510f9cb652 perf(shader): compute v_pk_fma_f16 and v_pk_fmac_f16 with OpFmaKHR
When the device has native f16 math and VK_KHR_shader_fma with shaderFmaFloat16, a packed f16
fma is one f16vec2 OpFmaKHR (SPV_KHR_fma). Vulkan requires OpFmaKHR to be correctly rounded and
to respect RoundingModeRTE and DenormPreserve, so it gives the fused, once-rounded result the f32
round-to-odd sum computes. The NaN, FP16_OVFL and clamp rules still run on the result bits.

Rebased onto current main by tibzejoker.

Co-Authored-By: thibaut <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PHJtpJ4hw3KWJhobipK8ia
2026-11-03 19:25:14 +01:00
mrfelek 5061d3e9ca fix(agc): retry a resource snapshot when a page it read changed backing
The snapshot check that let Materialize accept an attempt during which the
guest allocation generation moved looked only at the registered image
views. A remap of the memory the capture read descriptors from left those
views unchanged, so the attempt was accepted with descriptor words read
before the remap. The generation check on main did not cover this either:
ShaderMemory keeps the pages it read across attempts, so a retry read the
same cached words.

ShaderMemory now records the guest allocations behind each page when it
first reads it. The runtime hook, now snapshotCurrent, drops every page
whose allocations changed, so the next attempt reads it again, and accepts
the attempt only when no page changed and the image views are current.

agc_shader_memory gains a directly bound sampled array image case through
the real CaptureRegisteredViewsCurrent (an unrelated mapping during the
attempt is accepted and keeps the view, a resize of the image's own range
is retried) and a capture whose descriptor page is remapped mid-capture,
which must return the descriptor written after the remap.

AI-assisted.
2026-11-03 17:58:17 +01:00
mrfelek 0ac232a33a fix(agc): keep the directly bound image views in the resource snapshot
Materialize cleared registeredImages before adding the table views, which
dropped the views materializeSnapshot registers for directly bound images
on every attempt. materializeSnapshot already starts each attempt from an
empty snapshot, so the clear is removed.

AI-assisted.
2026-11-03 17:26:39 +01:00
Dean Galvin 635f569fea Merge main 4f41f4c375 into #7223 (7f36e41c45)
Conflicts resolved:
- libSceAgcDriver CMakeLists.txt: main moved test registration into tests/cmake/<exe>.cmake (tools/agc_test_split.py resolve); this branch's nested image table tests now sit in agc_driver_image_table_tests.cmake, and its nested snapshot retry test sits next to main's descriptor phis test in agc_shader_memory_tests.cmake.
- ResourceMaterializer.cpp: table equality compares both this branch's nested/pointers and main's resourceViews; the footprint counts main's resource views and this branch's pointers.
- ShaderDiskCache.cpp: both sides grew the descriptor source record (this branch: TableColumn::buffer, 1 byte; main: requiredBlocks, an 8-byte count), so the decoder minimum is 72 + 1 + 8 = 81, and the field-count asserts are DescriptorSource 4 and TableColumn 19.
- ShaderDiskCache.hpp: FormatVersion 56, an unclaimed number (main has 52; 53, 54 and 55 are already set by other open PRs).
- ResourceMaterializer.cpp (semantic, no text conflict): main added the per-image resourceViews loop to Snapshot(source, table), and it uses the top-level table index; this branch moved that copying into CopyRecords(), which nested tables share and which has no table index. The loop now runs in Snapshot right after CopyRecords, as on main; nested tables carry no resource views, as before.
2026-11-04 04:43:38 +13:00
Nicolas GonzalezandClaude Opus 5.5 4284c39bc3 fix(shader): keep the size check of scalar reads through a V# whose size is not whole DWORDs
Where robust loads are not exact, a driver may round a binding's range up
to a DWORD (RADV does), so a V# of 7 bytes gets a length of 2 DWORDs and
the length check passes the DWORD at byte 4 that the V# size excludes.
Specialize the low two bits of the V# size in the free fourth word of the
buffer's specialization slots, key the binding plan and the result memo
on it, and keep the carry-only guard only when both the base and the size
are whole DWORDs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 11:15:20 -03:00
Nicolas GonzalezandClaude Opus 5.5 b6c87fa45f perf(shader): check only the carry on scalar buffer reads bound to their exact range
A scalar buffer read through a static V# checks the carry, that the V# is
present and the offset against the V# size in 64 bits, and then the
offset against the binding's length. When the V# base is DWORD aligned,
the binding starts at the base and spans the V# size (less where it is
cut), and a V# that is not present is bound to the empty placeholder, so
the length check alone gives the same value once that placeholder reads
as zero. Zero the placeholder when it is created and keep only the carry
check there. A base off a DWORD boundary keeps every check, since its
view is rounded up a DWORD. Devices with exact robust loads have no
length check and are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 11:15:20 -03:00
mrfelek 9e07f78acb fix(agc): accept a resource snapshot when only unrelated allocations moved
ResourceMaterializer::Materialize retried whenever the guest allocation
generation moved during an attempt, and threw "runtime resource snapshot
did not stabilize" after three. Any allocation change moves it, so a
title that maps memory while it loads can move it during every attempt.
PPSA22408 aborted that way during loading in 2 of 2 runs with #11346 and
its COND_INDIRECT_BUFFER change, and in about 1 of 3 otherwise.

A new SrtRuntime hook, imageViewsCurrent, checks whether the image views
a snapshot registered still match their allocations. The driver backs it
with CaptureRegisteredViewsCurrent, the check its dispatch cache already
uses. Materialize accepts an attempt whose generation moved when the
check passes, and retries as before when it fails or no hook is set.

AI-assisted.
2026-11-03 14:15:48 +01:00
fma-rc 3cb6fb3ebb fix(recompiler): reduce a 3D gather's wrapped texel index with an unsigned remainder 2026-11-03 12:41:25 +01:00
fma-rc 80f07b510f fix(recompiler): count the volume gather field next to main's optional descriptor field in the disk cache info encoder 2026-11-03 12:39:01 +01:00
fma-rc a3834314f8 fix(recompiler): pair a 3D gather's state only with its own sampler and keep z half border out of border handling
A 3D sample of the same image through another sampler no longer feeds the gather's
state, z modes 4 and 5 no longer count as border addressing, a null image no
longer divides by a zero extent, and the test covers per-axis modes, rounding
ties, denormals, null images and the vertex stage.
2026-11-03 12:37:05 +01:00
fma-rc a6def73399 fix(recompiler): reduce 3D gather coordinates by addressing mode and snap their exact product 2026-11-03 12:37:04 +01:00
fma-rc a153f095d5 fix(recompiler): snap 3D gather coordinates to 1/256 texel before the footprint 2026-11-03 12:37:04 +01:00
fma-rc e26a9c81ca fix(recompiler): address a 3D gather by the sampler's clamp modes and border color 2026-11-03 12:37:04 +01:00
fma-rc f75385c1a2 fix(shader): gather a dim-3D image_gather4_lz from one slice as measured 2026-11-03 12:36:49 +01:00
Filip Michalski e6ede174b5 fix(shader): clamp scalar buffer size before narrowing 2026-11-03 10:29:53 +01:00
Filip Michalski f482ec00e2 chore(shader): integrate current main for bounds review 2026-11-03 10:09:15 +01:00
Dean 81605d59ec Merge pull request #12132 from mrfelek/fix/descriptor-web-lane-index
fix(shader): fold descriptor web paths that hold the lane index or texels
2026-11-03 21:10:04 +13:00
Dean 66387a10ee Merge pull request #10000 from EagleBearerYS/feat/shader-sampler-limits
feat(shader): raise the sampler and sampled-pair limits past the 32-bit sampler masks
2026-11-03 21:09:43 +13:00