Commit Graph
265 Commits
Author SHA1 Message Date
Dean 6a6a35fdf5 Merge pull request #7965 from frankea/ps5-measured-1340
fix(libs): values measured on a PS5 (firmware 13.40) from inside retail games
2026-10-23 06:18:10 +13:00
Dean b7d1d47a5f Merge pull request #8083 from DavidSamir/feat/agc-barycentric-tessellation-strips
feat(agc): draw triangle strips through the barycentric tessellation stages
2026-10-23 03:22:55 +13: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
frankea 41d551eb60 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/prx/libSceSystemService/Export.cpp
2026-10-21 17:37:31 -04: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
David 46e2b86d0b Merge remote-tracking branch 'origin/main' into feat/agc-barycentric-tessellation-strips
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-21 22:17:56 +04:00
Adrià 95d17687ae Merge pull request #8267 from thuanquang/fix/amd-robust2
fix(agc): give AMD's proprietary driver robustBufferAccess2 again
2026-10-21 19:59:43 +02:00
David 6d8ff2d5b8 Merge branch 'main' into feat/agc-barycentric-tessellation-strips 2026-10-21 15:10:49 +04: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 Galvin 2baa2b5a6e docs(dev): describe the missing-interpolator debt entry without naming a title
Name no title, title ID or shader address in the entry. The mechanism text is unchanged.
2026-10-21 21:16:31 +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
frankea 15ed39fb98 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/libSceSystemService.md
2026-10-21 03:30:24 -04:00
thuanquangandClaude da5c7a895d fix(agc): give AMD's proprietary driver robustBufferAccess2 again
enabling it broke agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex
and agc_driver_subvector_loop on an RX 6700 XT. With #7623 and #7828 on
main, those tests pass with the feature on, in either library-mode order.
This reverts 48b394d1e and keeps the record of #7623's empty-mask test in
the s_subvector_loop debt entry.

Co-Authored-By: Claude <[email protected]>
2026-10-21 13:43:39 +07:00
Kovalev Vladislav c13d1b9309 docs(shader): remove resolved prebuilt discovery caveat 2026-10-21 12:43:00 +06: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
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
frankea 3205511d38 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/shader.md
2026-10-21 01:13:11 -04:00
Dean Galvin bc87535cb0 docs(dev): name retail titles by ID instead of by title
Debt entries name the titles they were measured on. Use the title ID, or "a retail title" where the sentence needs no identification. No technical content changes.
2026-10-21 17:34:40 +13:00
frankea 62b29b6e77 docs(debt): say where the 13.40 values were measured without naming the title 2026-10-20 22:10:29 -04:00
Dean 494182e051 Merge pull request #8201 from savvaniss/fix/shader-call-link-wave-size
fix(shader): check call link registers for both wave sizes when the size is unknown
2026-10-21 15:02:27 +13:00
frankea 78926e215c Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/libSceVideoOut.md
2026-10-20 22:01:26 -04:00
Dean GalvinandMuhammad Wasif Ali Wasif 490adefc09 Merge origin/main into PR 8134
Co-authored-by: Muhammad Wasif Ali Wasif <[email protected]>
2026-10-21 14:56:22 +13:00
Dean Galvinandmazen dc38f31983 Merge main into fix/skip-inaccessible-branched-scalar-load
Shader disk cache FormatVersion 43: main took 42 with #7966, and this
change also changes the cached plan.

Co-authored-by: mazen <[email protected]>
2026-10-21 14:23:05 +13:00
Dean 26740077bd Merge pull request #8144 from TheSovietWaffle/fix/recompiler-domain-computed-control-point
feat(shader): read domain inputs at a control-point index computed from data
2026-10-21 09:31:11 +13:00
MarcZX10 092a66773a docs(shader): record measured color compare formats 2026-10-20 19:53:00 +00:00
frankea 39e467915e Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/prx/libScePad/Export.cpp
#	core/libs/prx/libScePad/src/PadState.cpp
#	core/libs/prx/libSceVideoOut/src/PadInput.cpp
#	core/libs/tests/GuestPad.cpp
2026-10-20 13:34:08 -04:00
Dean baae66415c Merge pull request #5799 from SleglJan/fix/cube-output-modifiers
fix(shader): apply cube output modifiers whenever IEEE mode is off
2026-10-21 05:38:37 +13:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 243925113f fix(shader): order wave LDS accesses with a memory barrier on AMD's proprietary driver
A guest wave's lanes see each other's LDS writes without a barrier, so
the recompiler adds a subgroup-scope OpControlBarrier between an LDS
write and the next LDS access when the guest wave is one host subgroup
(WaveLdsScope). AMD's proprietary Windows driver 32.0.21042.62 (Vulkan
driver 2.0.353, "AMD proprietary shader compiler", Radeon 0x13c0)
compiles that barrier to s_barrier, as the pipeline's internal ISA
shows (26 s_barrier for the guest's 9 in a small LDS reduction). In a
workgroup of several waves, the waves that enter a branch holding LDS
accesses then execute extra s_barriers, which pair with the other
waves' barriers, and those waves read LDS before it is written. LLPC
compiles a subgroup-scope control barrier to a wave barrier instead.

PS5LM Plus (PPSA99581) answered with garbage on that driver: the first
compute dispatch of its first graph, an RMS norm with a 512-thread
wave32 LDS tree reduction, scaled every row except its first 32
elements by a partial sum, while NVIDIA matched a NumPy reference and
the inputs were identical.

On that driver the barrier is now a subgroup-scope OpMemoryBarrier,
which it compiles to no instruction. A 32-lane subgroup is one hardware
wave there, which runs its lanes in lockstep and issues its LDS
instructions in order; Vulkan does not guarantee that, so it is
recorded as debt. Other drivers keep the control barrier. The flag is
part of the shader cache key, and agc_shader_replay takes
--wave-lds-memory-barriers to replay a request the way that driver
compiles it.

agc_driver_lds_tree_reduction sums over eight wave32 waves the way the
guest does, with its last four steps inside one wave and no s_barrier
between them: before, thread 32 read 1936 instead of 32896 on the AMD
driver; it passes on AMD and NVIDIA now. agc_subgroup_barrier checks
the driver quirk and the emitted barriers on every runner. PS5LM Plus
now answers " Paris. It is the largest city in Europe ..." on the AMD
iGPU without flash attention, as on NVIDIA and the CPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 20:24:01 +05:00
Savvanis SpyrosandClaude Opus 5.5 267d211318 fix(shader): refuse a call link escape only at the wave size it escapes under
When the graph is built without the wave size and the return address
escapes under only one of wave32 and wave64, the graph records that size
and its error instead of throwing, and translation throws it only at
that size. A wave64 program that reads a compare mask written over a
call's link pair from a scalar instruction is now recompiled, while the
same program at wave32, where the high dword still holds the return
address, is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 18:13:18 +03:00
Dean 5ccf1824df Merge pull request #6679 from SleglJan/pr/merged-hull
feat(agc): run registered merged hull programs (binary type 3)
2026-10-21 04:12:03 +13:00
Adrià 6e9279c51a Merge pull request #7829 from JJenkx/fix/shader-bda-anchor-read-sync114
fix(shader): retain adjacent anchor byte loads on RADV
2026-10-20 16:05:32 +02:00
Jan ŠléglandClaude Opus 5.5 8b8219dcef feat(agc): run registered merged hull programs (binary type 3)
A registered type-3 hull program holds the local and the hull part of a
tessellation draw in one binary, addressed through SPI_SHADER_PGM_LO_LS
(SH 0x148) with no SPI_SHADER_PGM_LO_HS: the local part runs on the lanes
below s3[7:0] and writes LDS, an s_barrier follows, and the hull part runs
on the lanes below s3[15:8] and may store the registers the local part
filled. The draw decode asked 0x148 for a type-5 local half, and
PPSA11386 (007 First Light) stopped in its level load with "registered
program refers to an incompatible shader binary type".

The draw decode now gives a registered type-3 program both the local and
the hull role and marks the tessellation configuration mergedHull. The
local stage only passes gl_VertexIndex and gl_InstanceIndex in a 16-byte
record. The hull stage runs the whole program, one invocation per output
control point: v2 and v5 come from the record of control point
min(gl_InvocationID, inputs - 1), v3 is the relative vertex id, and the
LDS becomes a per-control-point output array that a control point writes
in its own record and reads in any record of its patch after the barrier.
Registers live across the barrier stay in the invocation.

The hull stage of a merged program runs at one lane per invocation on
every device (HostSubgroupSize 1). Its lanes are gl_InvocationID, not host
subgroup invocations, so the s_cbranch_execz around the local part tests
the invocation's own lane. With the device's subgroup it took a subgroup
ballot, and lavapipe, whose subgroup stages lack the tessellation control
stage, rejected the draw ("subgroup capability 61 is unsupported for
shader stage 2").

The lowering refuses more input than output control points, LDS writes
outside the own record, reads outside the patch's records, barriers that
some invocations do not reach or that sit in a loop, reads or writes of
another lane's register, outputs beyond the device limits, and fetch
subroutines. Type 3 is prepared with its stage group like type 5 and
takes its float mode from RSRC1_HS. The hull user-data address (SH
0x102/0x103) is optional for a merged program: s[0:1] take it, unchecked,
when the draw sets it and are zero otherwise.

Both stages refer to one binary, so a draw lists each code and header
region once (AppendProgramMemory); a request's memory regions must not
overlap. An indirect draw's record words go into every program whose user
data holds the register, so the hull stage of a merged program reads
them too.

mergedHull is part of the recompile cache key, the draw decode comparison
and the request serialization (version 39).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 15:55:50 +02:00
frankea 73bc20e93d Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-20 09:21:31 -04:00
Maz 53ed35b362 fix(shader): skip unreachable flat SRT loads under a known branch
Capture evaluated every flattened scalar slot even when a clean scalar
branch skipped it, so an inaccessible direct user-data root refused the
draw. Record flat-slot uses on resource control-flow blocks and evaluate
only the reachable ones; keep refusing taken and unresolved paths.

Fixes #8272.
2026-10-20 13:11:24 +04:00
thuanquangandClaude Opus 5.5 a5e1f83417 fix(shader): keep the 24-bit factor reads of 16-bit multiplies
#7018 reads the low-half factors of v_mul_lo_u16 and v_pk_mul_lo_u16
as 24-bit fields because AMD's Windows driver stores the full 32-bit
product when it knows both factors fit in 16 bits. #7673's fold of
BitFieldUExtract(x, 0, n) into x removed those reads when the program
had masked the factors to 16 bits, so agc_driver_mul_lo_u16_high_half
failed again on that driver. The folder now keeps a field read that a
multiply uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 15:18:13 +07:00
Adam Franke 9a027c0c0d Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	docs/dev/debt/shader.md
2026-10-20 00:03:49 -04:00
Dean dd4b765252 Merge pull request #7939 from DavidAmsellem/docs/image-atomics-32bit-gfx1100
docs: measure integer image atomics on 32-bit surfaces on gfx1100
2026-10-20 17:00:24 +13:00
Dean Galvin f06c9f9222 Merge main into pr-6604
# Conflicts:
#	docs/dev/debt/shader.md
2026-10-20 14:05:05 +13:00
battleblob1andClaude Opus 5.5 f95471ec6a feat(shader): read domain inputs at a control-point index computed from data
A domain program that picks one of its patch's control points from data
(Onimusha: Way of the Sword, PPSA27836, selects a corner with v_cmp and
v_cndmask before a buffer_load from the off-chip ring) was refused with
"the tessellation ring or LDS address is not affine in the control point
and relative patch". Computed indices were accepted only for hull LDS
reads.

- The address evaluator gives off-chip EvaluationInput reads the same
  dynamic term as hull LDS reads, and a value read from the patch's own
  ring or LDS no longer counts as depending on the relative patch index,
  since the lowered read takes the patch implicitly.
- When the program also uses its relative patch index as data, the
  index is replaced by the grouped patch instead of 0, which left a
  computed read's address pointing into another patch. Such reads now
  subtract their relative patch term, for hull and domain reads alike;
  reads in programs that do not use the index as data keep their address.
- The computed offset must be a whole number of control points, and the
  backend clamps the domain gl_in index to the last output control point
  as it already does for hull reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 03:05:55 +03:00
Adrià 25ab3510ca Merge pull request #7623 from thuanquang/fix/subvector-loop-exec-zero
fix(shader): test an empty exec mask in s_subvector_loop_begin with one compare
2026-10-20 01:41:41 +02:00
davidamsellem 5882b2d449 docs: cite the gfx1031 image atomic measurement, float atomics included 2026-10-20 00:09:52 +02:00
davidamsellemandClaude Opus 5.5 e91d7a16bb docs: measure integer image atomics on 32-bit surfaces on gfx1100
The entry stated that image atomics on 32_SINT and 32_FLOAT act on the
raw dword with no measurement behind it. On gfx1100 the 13 integer image
atomics return and store the same raw-dword results on 32_UINT, 32_SINT
and 32_FLOAT, while 16_UINT and 8_8_8_8_UINT controls differ. gfx1100
has no float image atomics, so that part stays open.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-20 00:09:34 +02:00
David 573d85e2b8 Merge remote-tracking branch 'origin/main' into feat/shader-barycentric-tessellation-last-vertex 2026-10-20 01:20:06 +04:00
David ba9991c648 docs(debt): record triangle strips through the barycentric tessellation stages 2026-10-20 00:39:46 +04:00
Dean Galvin adf8e05f46 Merge main into pr-7042
# Conflicts:
#	core/shader/recompiler/Translation/include/Translation/TranslationContext.hpp
#	core/shader/recompiler/Translation/src/Float64Instructions.cpp
#	docs/dev/debt/shader.md
2026-10-20 09:25:06 +13:00