Commit Graph
1820 Commits
Author SHA1 Message Date
Dean 348157914f Merge pull request #6218 from harry-z-kang/codex/issue-6119-packed-storage
fix(agc): support packed 16-bit storage images
2026-10-23 22:44:30 +13:00
Adrià 0db47b263d Merge pull request #7831 from MarcZX10/codex/fix-perspective-offset-barycentrics-7825
fix(shader): normalize offset perspective barycentrics after interpolation
2026-10-23 07:37:02 +02:00
Dean 16319642a4 Merge pull request #6946 from Raghav314/perf/agc-draw-pipeline
perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE)
2026-10-23 18:24:48 +13:00
MarcZX10 62bd4638d2 fix(shader): bump cache format for barycentric metadata 2026-10-23 06:32:27 +02:00
MarcZX10 f6826208fb fix(shader): normalize offset perspective barycentrics 2026-10-23 06:32:27 +02:00
Dean a701f9f788 Merge pull request #6801 from JJenkx/feat/geometry-points-sized
feat(agc): rasterize geometry points with their point size
2026-10-23 14:38:10 +13:00
Dean Galvin 6990044dfb Merge main into feat/geometry-points-sized 2026-10-23 12:43:00 +13:00
Yunus Shaikh 3ded7d3269 fix(recompiler): hold the result-key memo in AtomicSharedPtr so libc++ builds
ResultKeyMemo declared std::atomic<std::shared_ptr<...>>. libc++ has no
atomic<shared_ptr> specialization, so with Apple clang the recompiler
headers stop at std::atomic's trivially-copyable static assertion
(request_serializer_tests in the macOS relinker build). The memo now uses
AtomicSharedPtr from libc, which is that specialization where the library
provides it and a locked shared_ptr with the same load and store otherwise.
The header joins the shader disk cache key's sources, and
request_serializer_tests gets core/libs on its include path.
2026-10-23 03:46:57 +05:30
raghav314andClaude Opus 5.5 c0dbd1871c perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE)
The second half of a pipelined draw (stage materialization, cache insert,
enqueue) runs on a finisher thread, overlapping the next draw's packet
work; draws whose stages could write memory are held back. Commits skip
work whose inputs did not change since the last commit, color metadata
passes are ordered through the pipeline, resource and storage-image proofs
are reused within one collect epoch until a write breaks them, and a shape
entry is refreshed in place at the second sight of the same read user words.
APS5_VERIFY_DRAW_PIPELINE checks reused proofs against a full check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 03:46:57 +05:30
Dean 944ff6c97e Merge pull request #9249 from Pacuka/fix/shader-3d-store-2d-array-tsharp
fix(shader): accept 3D image stores on 2D-array T#s
2026-10-23 11:06:04 +13:00
Adrià 7c900bbc21 Merge pull request #6645 from DangerChamp/codex/fix-completed-pixel-lane-proofs
fix(shader): reuse completed pixel lane proofs
2026-10-22 22:34:50 +02:00
Dean a62feecd6c Merge pull request #7948 from Amoenus/codex/feat-native-owner-fmask
feat(agc): expose expanded FMASK for tracked native owners
2026-10-23 08:54:11 +13:00
Kang, Harry Zixuan 4f26c7e35f refactor(shader): isolate packed storage conversion from SINT stores 2026-10-22 12:39:54 -07:00
Kang, Harry Zixuan 812928af24 fix(agc): support packed 16-bit storage images 2026-10-22 12:39:54 -07:00
cd0c8c1cf0 fix(shader): reuse completed pixel lane proofs
Memoize successful entry-lane proofs without retaining results that depend on active Phi cycles. Add regression coverage for saved EXEC-mask loops on narrower host subgroups.

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Ondra97 <[email protected]>
2026-10-22 21:11:46 +02:00
Adrià 3cd82ffe47 Merge pull request #8884 from thuanquang/fix/tess-constant-attribute-indices
fix(shader): index tessellation attributes at a constant address with constants
2026-10-22 19:43:05 +02:00
LeandroLP23andClaude Opus 5.5 1bf43f9b02 fix(recompiler): read P20 of a flat input as the provoking vertex
A FLAT_SHADE input without pass-through that a pixel shader reads
through v_interp_mov_f32 P20 and not P10 stayed an explicit per-vertex
input and read vertex 2 minus vertex 0. For a flat value that is the same
on every vertex the difference is 0, and with the first provoking vertex
nothing refused it.

ps5-opengl lowers every flat input to a load of one vertex: vertex 1
(P10) by default, which #4030 reads as the provoking vertex, and vertex 2
(P20) for triangles when GL's flatshade_first is set. SuperTuxKart's
deferred point lights are drawn that way, so all twelve flat inputs of
pointlight.frag read 0, the attenuation 0 * -inf was NaN, nothing was
discarded, and the starting-line referee's light quad blacked out the
scene behind it (#8364).

A P20-only read now returns the provoking vertex's value, as P10 and P0
do. The lane was not measured on the console either, so FragmentParameter
records it and a pipeline using the last provoking vertex throws. An input
read through both P10 and P20 keeps its per-vertex differences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:37:47 +02:00
Romans Pokrovskis b8c6a94572 chore(agc): refresh PR 7948 on current main 2026-10-22 19:13:40 +03:00
Get-fix a13d01bcc9 fix(shader): keep the PS5 user-data pointer check unchanged outside PS4 shaders
unchangedUntil skipped a write by the reading instruction itself for every shader, so an RDNA s_load that overwrites its own address pair was taken as a user-data pointer load where main refused it. The skip now applies only to PS4 (GCN) shaders, where it is needed; PS5 shaders take main's path.
2026-10-22 12:19:13 +03:00
11d145855e fix(shader): keep the literal word of a GCN s_setreg_imm32_b32
The SOPK branch of the GCN decoder never set the literal for
s_setreg_imm32_b32, so the eight-byte instruction was re-encoded as one
word and its decode threw "literal operand word is out of the code span
bounds". The decoder now copies the literal for that opcode; the new
agc_gcn_decode test decodes the reported stream.

Co-authored-by: javierUDP <[email protected]>
Co-authored-by: Savvanis Spyros <[email protected]>
2026-10-22 12:17:44 +03:00
Get-fix 4b717912d7 feat(shader): decode PS4 (GCN) shaders by re-encoding them to RDNA
Each GCN instruction is re-encoded to its RDNA form and decoded by the
existing RDNA decoder, so the PS4 path shares the recompiler. Covers the
legacy VS stage (program at the VS slot, user SGPRs from s0, vertex and
instance index in v0-v3), fetch shaders linked as user-data calls, MIMG
(image_sample and friends), PS4 buffer descriptors (GCN DATA_FORMAT /
NUM_FORMAT, 44-bit base) and T# image descriptors (GCN tiling in word 7).
The GCN switch is keyed into the shader disk cache. PS5 behaviour is
unchanged: every PS4-only rule is gated on GcnGuestShaders().
2026-10-22 12:17:44 +03:00
thuanquangandClaude e4de56f3ce fix(shader): clamp a domain read at an immediate address to the last control point
The dynamic path of TessellationPointer passes the control point through
inPatch(), which clamps it with UMin to inputControlPoints - 1 for hull
inputs and to outputControlPoints - 1 for domain inputs. The immediate
path clamped only hull inputs, so a domain read at an immediate address
past the last control point indexed the input array past its end. It
now clamps domain inputs to outputControlPoints - 1 too.

Co-Authored-By: Claude <[email protected]>
2026-10-22 10:39:26 +07:00
Adrià 415fd7136b Merge pull request #8991 from Tamalero/fix/shader-image-table-split-tsharp-halves
fix(recompiler): match image-table T# halves offset before and after readfirstlane
2026-10-21 21:53:27 +02:00
Dean 3594eee9f3 Merge pull request #6604 from notaxeltv/fix/recompiler-default-past-num-interp
fix(recompiler): fill missing pixel interpolators as DEFAULT
2026-10-22 08:31:15 +13:00
Adrià 1698d1ea6a Merge pull request #8642 from MarcZX10/codex/color-compare-format-support-7934
fix(agc): match measured color comparison formats
2026-10-21 21:02:30 +02:00
TamaleroandClaude Opus 5.5 9998385047 fix(recompiler): match image-table T# halves offset before and after readfirstlane
A T# loaded as two s_load_dwordx4 halves from a pointer table, where the
second half's offset is formed per lane (v_lshl_add_u32 key, 5, 16) before
v_readfirstlane and the first half's after it (readfirstlane(key) << 5),
was refused: the second half's +16 sat inside ReadFirstLane(Select(exec,
..., old), exec), so TryMakeTableColumn saw a different base and a zero
addend. Compare such offsets in a first-lane normal form (lane value, mask,
shift, addend), peeling selects the mask implies as the SRT walker already
does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 20:21:35 +02:00
PacukaandClaude Opus 5.5 adca8cfa2f fix(shader): accept 3D image stores on 2D-array T#s
A 3D image_store bound to a 2D-array T# addresses the layer as z. Add a 2D-array runtime mode for write-only 3D storage images and drop stores whose layer is past the array.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:31:33 +02:00
JJenkx b779c90159 test(shader): retain sample order through legacy point replay 2026-10-21 09:13:32 -04:00
JJenkx 19be2835f2 test(shader): preserve legacy point requests after denorm serialization 2026-10-21 09:13:32 -04:00
JJenkx ee9b1c8249 test(shader): upgrade legacy point requests to version 40 2026-10-21 09:13:32 -04:00
JJenkx 70c8476c7c test(shader): align request version guards after float flush merge 2026-10-21 09:13:32 -04:00
JJenkx c750708c8d test(shader): preserve depth remap requests through point replay 2026-10-21 09:13:32 -04:00
JJenkx 8409360d40 test(shader): retain request versions through 34 for point replay 2026-10-21 09:13:32 -04:00
JJenkx 95a2a45fe3 test(shader): preserve version 32 requests with spanned waves 2026-10-21 09:13:32 -04:00
JJenkx 4f76eb75ce feat(agc): apply register and exported sizes to mesh points 2026-10-21 09:13:32 -04:00
milescovielloandClaude Opus 5.5 89be76cb4c test(shader): check version 39, 41, 42 and 43 requests with merged hull and point state
A tessellated vertex request with the merged hull flag and a point list
serializes as version 43 with both. Without its point tail it reads as
main's version 42, without the pixel sample order as version 41, and
without the f32 denormal preserve flag as version 39, each keeping the
merged hull flag and taking the default point state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 09:13:32 -04:00
milescovielloandClaude Opus 5.5 11bc7b1686 fix(shader): move the vertex point fields to request version 43
main took request versions 33 to 42 for other fields, the last of them
the pixel sample order, so requests of those versions from main have no
point-list tail. The point fields now come with version 43, after them,
and the tests expect 43 and reject 44.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 09:13:32 -04:00
milescovielloandClaude Opus 5.5 f3433b0a11 fix(agc): keep the written point size above zero
Vulkan needs PointSize above zero. A PA_SU_POINT_SIZE of 0 without
USE_VTX_POINT_SIZE, and a PA_SU_POINT_MINMAX maximum of 0 with it, now
throw. With USE_VTX_POINT_SIZE the clamp's lower bound is at least the
smallest positive float, so an exported size of 0 or less, which a
clamp minimum of 0 lets through, is written as a positive value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 09:13:31 -04:00
milescovielloandClaude Opus 5.5 e7ea490325 feat(agc): draw point lists on the vertex path with their point size
A point list routed through the vertex path was refused, and so was
PA_CL_VS_OUT_CNTL.USE_VTX_POINT_SIZE on it. OliSe Player (PPSA01153)
stops on the latter with two of its MilkDrop presets.

The vertex path now draws point lists as Vulkan points. The vertex stage
writes PointSize: the misc export's X clamped to PA_SU_POINT_MINMAX when
USE_VTX_POINT_SIZE is set, and the PA_SU_POINT_SIZE height otherwise.
The point state travels in the recompile request (version 31) and the
cache and draw keys. Non-square register sizes, inverted clamps, point
sprite texture coordinates and, without largePoints, sizes other than
one pixel throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 09:13:09 -04:00
Dean ce7d547175 Merge pull request #8856 from klosixgaming-arch/feat/agc-point-list-geometry-output
feat(agc): draw point-list output of NGG geometry programs as mesh points
2026-10-22 01:46:18 +13:00
Adrià 98145b48d8 Merge pull request #7426 from DavidSamir/feat/shader-barycentric-tessellation-last-vertex
feat(agc): draw the last provoking vertex through the barycentric tessellation stages
2026-10-21 13:08:47 +02:00
Dean aa37bc7aef Merge pull request #6683 from EagleBearerYS/fix/agc-sample-location-grid-exact
fix(agc): keep the guest's sample order where pixel (0,0)'s locations stand in for a 2x2 grid
2026-10-21 23:00:12 +13:00
Dean Galvin efb4ac4773 Merge origin/main into PR 6604 2026-10-21 21:12:11 +13:00
Dean 854a514bbe Merge pull request #7945 from veosett/codex/windows-cache-housekeeping-safety
fix(shader): avoid unsafe Windows cache directory traversal
2026-10-21 20:57:27 +13:00
Yunus Shaikh 8c9c8eb5b5 Merge main into fix/agc-sample-location-grid-exact
main 7ce3b1df3e took disk-cache format 43 (#8295) for its own layout, so this
branch's format moves to 44. The request serializer stays at 42: main
still writes 41.
2026-10-20 23:48:14 -07:00
Dean 1aad07054d Merge pull request #8295 from mazen320/fix/skip-inaccessible-branched-scalar-load
fix(shader): skip unreachable flat SRT loads under a known branch
2026-10-21 19:34:07 +13:00
Dean 53a0a27bb6 Merge pull request #8134 from wachi35676/fix/shader-amd-wave-lds-memory-barrier
fix(shader): order wave LDS accesses with a memory barrier on AMD's proprietary driver
2026-10-21 18:46:41 +13:00
Yunus Shaikh 6d09797d6b Merge main into fix/agc-sample-location-grid-exact 2026-10-21 05:39:42 +00:00
thuanquangandClaude 054f8ff4de fix(shader): index tessellation attributes at a constant address with constants
TessellationPointer built the vertex, attribute and component indices of
an attribute access from its address with OpUDiv, OpUMod, OpShiftRightLogical
and OpBitwiseAnd even when the address was an immediate, and without
SPIRV-Tools nothing folded them. AMD's Windows driver (32.0.21045.5002 on an
RX 6700 XT, 32.0.21042.62 on an RDNA 2 iGPU) reads a per-vertex hull output
indexed that way wrongly: a merged hull program's level read came back
wrong, and agc_driver_tessellation drew a different wrong patch on each run.
A read of the program's own record through a constant index failed the same
way, and the test passes once the indices are OpConstants, as glslang emits
them.

The merged hull case now also checks that no access chain index of the hull
stage is arithmetic on constants, so the shape is caught on every device.

Fixes #8861

Co-Authored-By: Claude <[email protected]>
2026-10-21 12:30:46 +07:00
Dean Galvinandmazen 4977e87806 Merge main into fix/skip-inaccessible-branched-scalar-load
Shader disk cache FormatVersion stays 43 (main is 42).

Co-authored-by: mazen <[email protected]>
2026-10-21 18:25:02 +13:00