Commit Graph

615 Commits

Author SHA1 Message Date
boykopovar 20cfc0130f fix(agc): preserve write tracking for shared host import aliases 2026-10-09 10:59:50 +03:00
Adrià Franch 1910d1456d feat(shader): choose f32 arithmetic NaN results on the bits
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-09 09:14:44 +02:00
Adrià Franch ef4dca9a54 fix(shader): quiet signaling NaNs only in IEEE mode
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-09 00:33:02 +02:00
Adrià Franch f04ce007b6 feat(shader): follow DX10_CLAMP in the clamp modifier
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-09 00:25:07 +02:00
Adrià ce64d8eb36
Merge pull request #1850 from adriadam10/feat/shader-f32-denormal-flush
feat(shader): flush f32 denormals in the float modes that flush them
2026-10-09 00:24:54 +02:00
Adrià Franch f132f16155 feat(shader): flush f32 denormals in the float modes that flush them
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 23:59:24 +02:00
Adrià Franch d3f2611384 fix(shader): apply the output modifier only in the float modes where the hardware does
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 23:58:08 +02:00
Adrià ae91d9780b
Merge pull request #697 from queeeef/feat/interp-f16
feat(shader): implement v_interp_p1ll_f16, v_interp_p1lv_f16 and v_interp_p2_f16
2026-10-08 23:56:17 +02:00
Adrià 94b1eecb59
Merge pull request #533 from adriadam10/test/vop3p-packed
fix(shader): choose packed f16 NaN results on the bits, as RDNA does
2026-10-08 23:41:34 +02:00
Adrià dc79e9b1d6
Merge pull request #938 from CnRJay/feat/ds-src2-b32
feat(shader): implement the 32-bit DS src2 operations
2026-10-08 23:36:33 +02:00
Adrià Franch 8f663d0123 feat(shader): follow the float mode in 16-bit interpolation
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 23:36:04 +02:00
Daan Dehing 425836e73f fix(shader): give 16-bit interpolation NaNs the hardware priority
Measured on RDNA2 in #697: an invalid product or sum (inf * 0, inf - inf)
gives the negative default NaN, 0xffc00000 or 0xfe00, and beats a NaN
addend. A NaN delta, then a NaN coordinate, still wins, quieted; a NaN
addend is returned quieted only when the product is valid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:36:04 +02:00
Daan Dehing 7f53a48131 fix(shader): round each 16-bit interpolation step once, as on hardware
Measured on RDNA2 in #697: v_interp_p1ll_f16 and v_interp_p1lv_f16 are a
fused multiply-add rounded once to f32, and v_interp_p2_f16 rounds the exact
P20 * J + S2 once to f16. The separate multiply and add matched about 85% and
4% of the measured rows.

Both steps now use FPInterpolateF32 and FPInterpolateF16: the f16 delta times
the f32 coordinate is exact in f64, the sum is rounded to odd and then once to
nearest even at the target precision, so no driver can split or reround it.
Infinite and NaN operands take the unbounded f64 result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:36:04 +02:00
Daan Dehing daa6bee7cf feat(shader): implement v_interp_p1ll_f16, v_interp_p1lv_f16 and v_interp_p2_f16
Decode the three VOP3 16-bit interpolation instructions (attribute, channel
and high-half select in the src0 field, the I/J VGPR in src1, P0 or the first
step's result in src2) and translate them with a new
GetInterpolationParameterF16 IR value. It reads the selected 16-bit half of
each vertex's parameter through VK_KHR_fragment_shader_barycentric, so P10 and
P20 are vertex differences rounded to f16; both steps are a multiply and an
add, as in the f32 forms.

An input in FP16_INTERP_MODE whose low half is defaulted is still declared at
its slot when its high half is read, and the high half takes its default from
USE_DEFAULT_ATTR1 and DEFAULT_VAL_ATTR1. Without barycentrics, on an input
without FP16_INTERP_MODE or on a pass-through input the instructions throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:36:04 +02:00
Adrià Franch a000305181 fix(shader): choose packed f16 NaN results on the bits, as RDNA does
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 23:34:18 +02:00
Adrià aa258760dc
Merge pull request #1826 from adriadam10/feat/shader-ieee-minmax
feat(shader): follow IEEE_MODE in f32 min, max, min3, max3 and med3
2026-10-08 23:33:59 +02:00
Adrià 364a56b681
Merge pull request #1816 from adriadam10/feat/shader-float-mode-carry
feat(shader): carry the shader float mode into the recompile request
2026-10-08 23:16:04 +02:00
Adrià Franch be3bd9fbd7 fix(shader): refuse the f32 DS src2 operations until LDS float denormals are modelled
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 23:13:23 +02:00
Adrià Franch fe1f7b38af feat(shader): follow IEEE_MODE in f32 min, max, min3, max3 and med3
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 23:09:31 +02:00
Claude c0519cc814 feat(shader): implement the 32-bit DS src2 operations
The decoder threw on the GFX10.1 DS src2 opcodes 0x80-0x8b, 0x8d,
0x92, 0x93 and 0x95. Each reads DS[B], where B is the address plus
four times the 15-bit signed offset in offset1[6:0]:offset0, and
applies the matching operation to DS[A]: add, sub, rsub, inc, dec,
signed and unsigned min and max, and, or, xor, f32 min, max and add
through the 32-bit LDS atomics, and a plain write for
ds_write_src2_b32. The form that takes the offset from the address
bits (offset1[7]), the 64-bit forms and GDS still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:06:15 +02:00
Adrià Franch 0cbc9586bc feat(shader): carry the shader float mode into the recompile request
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 22:17:07 +02:00
Adrià Franch 57d4be33bb feat(shader): implement MIMG PCK2/PCK4 loads as measured on hardware
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 21:54:10 +02:00
Adrià Franch d5a3a4321c fix(shader): follow measured hardware for MIMG BY2/BY4 loads
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 21:28:22 +02:00
Adrià Franch 7f25d49fb8 fix(shader): fetch packed horizontal gather texels and cover edge coordinates
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 20:42:14 +02:00
Mark Kuebel d0551d381b feat(shader): implement image_gather4h_pck end to end
Decodes IMAGE_GATHER4H_PCK (MIMG opcode 98) and IMAGE_GATHER8H_PCK
(opcode 99), implements gather4h_pck through translation, the SPIR-V
backend and a GPU execution test, and documents gather8h_pck as a
desktop null-op.

Semantics were measured on gfx1031 hardware with hand-encoded MIMG
words (LLVM rejects the PCK gather mnemonics on every RDNA1/RDNA2
target). The measured rule for gather4h_pck: the four-texel horizontal
window is floor(u*width-0.5)+{-1,0,+1,+2} clamped to the width, the row
is floor(v*height) clamped, the raw bits of the window texels are
concatenated into a little-endian bitstream (texel k at bit offset
k*texelBits), and output register j - the j-th set DMASK bit in
ascending order - receives stream word j, zero past the end of the
stream. Exactly popcount(dmask) consecutive VGPRs are written from vdst
ascending; texels wider than 32 bits write zeros (hardware limit); rows
past the height read zeros; negative coordinates clamp to zero. The
window anchor matches the repo's existing PS5-validated HorizontalOffsets
rule, so this reuses the established convention.

The decoder accepts multi-bit DMASKs for these two opcodes only and
sizes their data span as popcount(dmask) (measured), unlike gather4h
which always writes four components. Translation carries the packed
flag through imageMemoryInfoFromInstruction; the SPIR-V emitter
reassembles the bitstream per lane with per-texel OpImageFetch and
byte assembly. D16 data throws until measured.

gather8h_pck never returns texel data on this hardware: across dmasks
0x1-0xFF including the upper nibble, RGBA8/RGBA16/RGBA32 formats, 1D/2D
and 3D descriptors, normalized and unnormalized sampling, sentinel-
prefilled destination registers confirm it only ever zero-fills
popcount(dmask) registers. It decodes but throws at translation.

The measured semantics and the gather8h_pck null-op are recorded in
docs/dev/TechnicalDebt.md.
2026-10-08 20:42:03 +02:00
Sanjaysrinivas 4d2917e632 fix(shader): guard scalar call link lifetimes
Reject tuple and descriptor overlap, wrong-pair returns, relative SGPR reads, reversed regions and ordinary or conditional fall-through into a callee. Preserve the existing scalar write analysis and require exact return-pair matching.

Seven targeted regressions fail before these guards and pass afterward. Seven focused CMake tests and 15 SPIR-V validations pass; the execution matrix passes 3,200 comparisons and detects a one-bit expected-output mutation.
2026-10-08 20:23:47 +02:00
Sanjaysrinivas ee0b1109f4 feat(shader): execute bounded S_CALL_B64
Reuse the prerequisite call-region analysis for signed relative calls, including callees after s_endpgm. Lower the saved link as shader base plus PC+4 and reject unsupported targets and call shapes.

Add decoder, IR, CFG and Vulkan execution regressions. Seven focused CMake tests pass; five layouts cover 15 dispatches and 3,200 output comparisons on lavapipe. Record ISA sources and native RDNA2/PS5 limits in TechnicalDebt.
2026-10-08 20:22:51 +02:00
ebosido444-ai c48e01977d feat(shader): implement s_swappc_b64 fetch-shader call
Decodes SOP1 0x21 s_swappc_b64 (link pair = pc + 4) and resolves its call/return pairing through the existing s_setpc_b64 path: static call regions in GraphBuilder and the vertex-entry fetch-shader call inlined from the parsed fetch-shader plan. s_call_b64 (SOPK 0x16) and s_rfe_b64 (SOP1 0x22) throw at decode. Unmodeled cases throw; see docs/dev/TechnicalDebt.md.
2026-10-08 20:05:24 +02:00
Adrià Franch d3afdb02e2 docs(architecture): describe shader compilation at registration
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 19:47:03 +02:00
Adrià 700c0babc6
Merge pull request #1468 from arvindfroi/refactor/ajm-wvorbis-names
refactor(libSceAjm.native): name the WVorbis stubs by their NIDs
2026-10-08 16:36:34 +02:00
Adrià 7a047bc171
Merge pull request #1441 from ToyuAU/fix/windows-import-watch
fix(agc): compare Windows host imports after late driver writes
2026-10-08 16:12:45 +02:00
Adrià 3c0756ee87
Merge pull request #1467 from arvindfroi/refactor/psml-mfsr2-names
refactor(libScePsml_debug): name the Mfsr2 stubs by their NIDs
2026-10-08 16:00:30 +02:00
Dean 74b5c9103b
Merge pull request #788 from Celegans12/feat/videoout-dcc-visible-keys
fix(agc): store and read DCC keys over the console's metadata extent
2026-10-09 02:59:52 +13:00
Adrià 123a3c0365
Merge pull request #1443 from camezaro-intc/feat/font-dettach-device-cache-buffer
feat(font): implement sceFontDettachDeviceCacheBuffer
2026-10-08 15:58:18 +02:00
Adrià 461fcfc7f3
Merge pull request #1436 from tototomate123/fix/hfw-offline-imports
fix(prx): add missing HFW imports with strict offline handling
2026-10-08 15:52:39 +02:00
Adrià 5fbddcdf53
Merge pull request #1435 from ewraj/fix/linux-guest-varargs
fix(libc): read every variadic argument of the Linux printf and scanf exports
2026-10-08 15:52:17 +02:00
Adrià 63c57d2222
Merge pull request #1432 from ToyuAU/build/standalone-relinker
build(relinker): add a dependency-free conversion build mode
2026-10-08 15:43:51 +02:00
Adrià Franch fd70266372 docs: move the Windows import TechnicalDebt line to Functional
It records a behaviour gap, not a silent stub, and sat at the end of its section.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 15:32:46 +02:00
ToyuAU c01044eeaa fix(memory): restore write tracking for fresh private backing 2026-10-08 15:32:42 +02:00
ToyuAU 838d02a88c fix(agc): compare Windows host imports after late driver writes 2026-10-08 15:32:42 +02:00
Celegans12 1816aea91c fix(agc): store and read DCC keys over the console's metadata extent
The console's DCC of a single-level 4-byte SW_64KB_R_X surface is
ceil(W/512) * ceil(H/512) * 4096 bytes, 49152 for 1920x1080, but the
driver stored and read one key per 256 surface bytes (34560).
PPSA26344 retiles its render DCC into the displayable copy it
registers (cs_dcc_retile_32bpp); a retile of the stale tail gives the
mixed keys PPSA12544 stops on.

DccKeyCount gives that extent. Color target and storage image key
stores cover it when the DCC is pipe-aligned (CB_COLOR_ATTRIB3 bit 30,
T# word 6 bit 19), whose CB keys reach its last meta block, and throw
where it is not writable; unaligned DCC keeps one key per 256 bytes,
as do texture and color target key reads. DisplayBufferKeys reads the
display DCC over the extent, presents only when every key agrees,
names the first differing key's pixels and checks a pending image
against those keys.
2026-10-08 15:24:43 +02:00
Adrià f4028921f8
Merge pull request #1412 from TheAggie/fix/recompiler-ngg-vertex-wave-info
fix(recompiler): give vertex-path shaders a full NGG merged wave info
2026-10-08 15:08:22 +02:00
Adrià c68c7576b9
Merge pull request #1399 from hugodearaujo/fix/rtc-parse-datetime-rfc2822-hardware
fix(rtc): parse RFC 2822, RFC 850 and asctime text like the console
2026-10-08 15:05:42 +02:00
Adrià Franch c39476459b docs: record the inferred NGG merged wave info layout in TechnicalDebt
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 15:05:40 +02:00
Adrià fd5f63a2d0
Merge pull request #1393 from xsvm/fix/relinker-rewriter-reference-sites
fix(relinker): classify rewrite reference sites with the instruction decoder
2026-10-08 15:03:48 +02:00
Adrià 79d23eb76c
Merge pull request #1321 from TibixDev/pr/guest-path-case
fix(libc): resolve case differences in guest paths and mounts
2026-10-08 15:01:28 +02:00
Adrià 09a17e963a
Merge pull request #1398 from hugodearaujo/fix/rtc-parse-datetime-iso-hardware
fix(rtc): parse ISO text in sceRtcParseDateTime by the RFC 3339 rules
2026-10-08 14:56:12 +02:00
Adrià e08c816abc
Merge pull request #1383 from nisbenz/fix/shader-memtime-narrow-subgroup-clock
fix(shader): read s_memtime from the device clock where RADV's subgroup clock is 20 bits
2026-10-08 14:51:41 +02:00
Adrià 0596a7a274
Merge pull request #1385 from gjonn/feat/recompiler-lwe-on-samples
feat(recompiler): accept lwe on MIMG samples and gathers
2026-10-08 14:43:27 +02:00
nisbenz f025a9e506 fix(shader): read s_memtime from the device clock where RADV's subgroup clock is 20 bits
On GFX10.3 to GFX11.7, ACO lowers a subgroup-scope OpReadClockKHR to
s_getreg_b32 of SHADER_CYCLES, 20 bits zero-extended to 64, so s_memtime
wrapped every 2^20 cycles and went backwards. Detect those families from
the RADV device name and read the device clock there instead.

Fixes #985

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 14:42:40 +02:00