Commit Graph

1370 Commits

Author SHA1 Message Date
Phi1ow e4bc4a4ecb fix(pad): check the handle and keep the dead band throwing when enabled
Per review: scePadSetAngularVelocityDeadbandState now returns PAD_ERROR_INVALID_HANDLE for a
handle other than PAD_HANDLE, like the neighbouring setters. Enabling the dead band still throws,
because the angular-velocity reading path does not apply the filter (that would change input, not
UI, so it is not a silent stub); disabling it succeeds, which matches the unfiltered readings.
The test checks the disabled call, the bad handle, and no longer asserts the enabled path.
2026-10-05 00:48:45 +02:00
Phi1ow 1cd34c232d feat(pad): implement scePadSetAngularVelocityDeadbandState
scePadSetAngularVelocityDeadbandState was the last throwing stub in libScePad. It toggles a
dead-band filter on the controller's angular-velocity (gyro) readings; the reading path does
not apply that optional filter, so the call succeeds and does nothing, as it does in shadPS4.

Extends the existing guest_pad test with the two enable/disable calls. It fails on main (the
stub throws) and passes with the change.
2026-10-04 23:19:37 +02:00
Dean d7f0c49fdc
Merge pull request #532 from adriadam10/fix/audio-in-pacing
fix(audioin): never return a no-device block before its deadline
2026-10-05 07:37:03 +13:00
Adrià Franch a32a593762 fix(audioin): never return a no-device block before its deadline
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 17:27:50 +02:00
Dean 2cf901bcff
Merge pull request #401 from MichonGoddijn231849/perf/buffer-pool-buckets
perf(agc): keep the buffer pool's free slots by key and retain 4096
2026-10-04 22:56:48 +13:00
Dean 0bd5766246
Merge pull request #394 from MichonGoddijn231849/feat/mipmapped-3d-textures
feat(agc): mipmapped 3D textures
2026-10-04 22:56:31 +13:00
Dean 1104cfce5b
Merge pull request #404 from MichonGoddijn231849/perf/color-swizzle-tables
perf(agc): build the color target swizzle tables once per element size
2026-10-04 22:56:14 +13:00
Dean 0623b69325
Merge pull request #376 from MichonGoddijn231849/feat/depth-bounds-bias
feat(agc): depth bounds test and depth bias
2026-10-04 22:55:57 +13:00
Dean bd753903e3
Merge pull request #294 from MichonGoddijn231849/split/color-target-gaps
fix(agc): color targets with gaps between written MRT slots, depth array slices
2026-10-04 22:55:40 +13:00
Dean 97822deb0b
Merge pull request #446 from adriadam10/feat/vop3-f64-basic
feat(shader): implement basic f64 VALU ops
2026-10-04 22:55:23 +13:00
Dean ce8b0838ee
Merge pull request #471 from adriadam10/perf/single-front-end
perf(shader): build a shader's front end once on first use
2026-10-04 22:55:06 +13:00
Dean 6a4bbade0d
Merge pull request #435 from adriadam10/feat/vop3-mad-i64-i32
feat(shader): implement v_mad_i64_i32
2026-10-04 22:54:49 +13:00
Dean 13cbbfa7f7
Merge pull request #325 from adriadam10/feat/relative-indexing
feat(shader): implement v_movrelsd_b32, v_movrelsd_2_b32, v_swap_b32 and v_swaprel_b32
2026-10-04 22:54:32 +13:00
Dean f4071f2469
Merge pull request #331 from adriadam10/feat/format-d16-stores
feat(shader): implement the D16 format buffer stores
2026-10-04 22:54:11 +13:00
Dean 1f4e030374
Merge pull request #330 from adriadam10/fix/formatted-store-conversion
fix(shader): convert formatted buffer stores to the element format
2026-10-04 22:53:54 +13:00
Dean 598833214b
Merge pull request #329 from adriadam10/feat/format-d16
feat(shader): implement the D16 format buffer loads
2026-10-04 22:53:37 +13:00
Dean 5ce9600d87
Merge pull request #319 from adriadam10/feat/d16-memory
feat(shader): implement the D16 byte/short loads and high-half stores
2026-10-04 22:53:20 +13:00
Michon 66a46259d1 fix(agc): pad tiled 3D mip levels from their size rounded up, as addrlib does
addrlib sizes a non-tail level with ShiftCeil; the layout used the image's
rounded-down extent, so volumes with a non-power-of-two width or height (33x20x12
in the new test) got a different layout.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-04 10:27:32 +02:00
Michon efde918a62 feat(graphics): mipmapped 3D textures
3D textures with more than one mip level were refused. Each slab of
blockDepth slices of a thick (SW_4KB_S / SW_64KB_S) volume now holds the
whole mip chain, smallest level first and level 0 last, as 2D chains are
laid out. A level's depth halves per level, so the texture loops skip the
slices a level does not have. Thin 3D (D/R 64KB_X) chains use the 2D mip
layout per depth slice. Thick mip tails still throw.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-04 10:27:32 +02:00
Dean 9f9a8f5a53
Merge pull request #340 from QDarkRex/fix/relinker-tls-fs-disp32
fix(relinker): load Windows guest TLS values at signed displacements
2026-10-04 20:39:50 +13:00
Adrià Franch e1b7ecc1c5 feat(shader): implement v_mad_i64_i32
Decode VOP3b 0x177 and translate it next to v_mad_u64_u32: the high half of
the product comes from SMulHi, and the carry-out is the sign of the exact
sum (bit 64 of the sign-extended product plus the sign-extended addend), as
measured on RDNA2 hardware.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 09:17:12 +02:00
Dean 8a64778581
Merge pull request #486 from RomainROCH/codex/fix-executable-segments
fix(relinker): validate all executable segments and preserve live imports
2026-10-04 20:09:49 +13:00
Dean 3237b6b548
Merge pull request #484 from RomainROCH/codex/fix-elf-string-bounds
fix(relinker): bound dynamic strings by the declared table size
2026-10-04 20:09:33 +13:00
QDarkRex ab5c339039 fix(relinker): reject guest TLS loads from unmodelled control block fields
Loads at fs:1 through fs:0x27 read tcb_dtv and tcb_thread on the FreeBSD layout, which the Windows thread control block does not model, so they returned zero. Accept only the TLS block, fs:0 and the stack guard at fs:0x28, and fail the relink for the rest.
2026-10-04 14:09:19 +07:00
Dean a75b2c9550
Merge pull request #316 from adriadam10/fix/wave32-subgroup-size
fix(agc): run wave32 compute programs on 32-wide subgroups
2026-10-04 20:09:16 +13:00
Dean 3357199fce
Merge pull request #243 from adriadam10/feat/audio-in-capture
feat(libSceAudioIn): capture from the host's recording device
2026-10-04 19:55:15 +13:00
Adrià Franch fe26911cbb fix(shader): build f32/f64 conversion NaNs from the bits
OpFConvert leaves NaN payloads to the driver; NVIDIA returns its own.
v_cvt_f64_f32 now shifts the f32 payload left by 29 and v_cvt_f32_f64
keeps the top 23 payload bits, both quieted, as RDNA does (60/60 NaN
conversions measured on RDNA2). F64NanConversions covers both with the
hardware rows.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:52:14 +02:00
Adrià Franch 6ea9750bf3 refactor(shader): read f64 operands through readF64Bits and record the v_fma_f64 subnormal gap
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:52:14 +02:00
Adrià Franch 6f20ed3778 fix(shader): compute v_fma_f64 exactly instead of relying on the driver
The Vulkan precision table defines GLSL.std.450 Fma as "inherited from
OpFMul followed by OpFAdd", so a driver may round twice. RADV fuses it,
the lavapipe in CI (Mesa 25.2.8, LLVM 20) does not, and F64Arithmetic
failed there on the fma rounding-error row.

v_fma_f64 is now emulated with operations Vulkan requires to be
correctly rounded: the operands are scaled to exponent 0, the product is
split exactly (Dekker), added to the addend with TwoSum, the low parts
are summed with round-to-odd and one final round-to-nearest gives the
fused result (Boldo and Melquiond). The result is scaled back by two
exact powers of two. Inf/NaN, zero factors and subnormal inputs take the
mul + add path, an addend 2^60 larger than the product is returned as
is. Matches the hardware on all 13253 fma results captured for #446 and
an exact model on 300000 random inputs incl. ties.

NaN results of add, mul and fract are also chosen on the bits (first NaN
input quieted, otherwise the default NaN) since Vulkan does not specify
which NaN an operation returns.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:52:14 +02:00
Adrià Franch b0afa04c77 feat(shader): implement basic f64 VALU ops
Decode and translate v_add/mul/fma/min/max/ldexp_f64, v_trunc/ceil/floor/
rndne/fract_f64, v_frexp_mant/exp_i32_f64 and the f64 <-> f32/i32/u32
conversions. f64 values stay as their raw bits (U64) in the IR and are
bitcast to double in SPIR-V, which needs the Float64 capability: the
device enables shaderFloat64 when it also preserves signed zero, inf and
NaN for 64-bit floats, and the shader declares SignedZeroInfNanPreserve 64.

Semantics measured on RDNA2 hardware (8209 inputs per op): literals are
the high dword, the 1/(2*pi) inline constant is the exact double,
omod is ignored, clamp maps NaN to +0, min/max quiet a
signaling NaN and drop a quiet one, NaN results are quiet, and the
integer conversions saturate with NaN -> 0. Truncation, rounding and
ldexp are done on the bits so they do not depend on the driver: lavapipe
returned wrong results for f64 RoundEven and Trunc, and GLSL Ldexp is
undefined past +-1024. Fma is NoContraction so RADV keeps it fused.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:52:14 +02:00
Dean b0a4a991cb
Merge pull request #334 from adriadam10/feat/ds-permute
feat(shader): implement ds_permute_b32
2026-10-04 19:42:21 +13:00
Dean dda274b5e7
Merge pull request #434 from adriadam10/feat/relinker-sha256-memory
feat(relinker): lower SHA-256 instructions with a memory operand
2026-10-04 19:42:10 +13:00
Dean ec720a351c
Merge pull request #437 from adriadam10/feat/vop3-qsad-mqsad
feat(shader): implement v_qsad_pk_u16_u8, v_mqsad_pk_u16_u8 and v_mqsad_u32_u8
2026-10-04 19:41:53 +13:00
Adrià Franch 7e5ce945e1 feat(libSceAudioIn): implement sceAudioInClose and throw for the unverified 0x10 format
Close releases the port and its host device; Input and Close on a port
that is capturing return BUSY. Format codes follow the PS5 SDK bindings
(SharpProspero) and KytyPS5: 1/2 S16 mono/stereo, 0x11/0x12 float.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:39:33 +02:00
Adrià Franch 29aa4f3cdf feat(libSceAudioIn): capture from the host's recording device
sceAudioInOpen validates the port and opens the default SDL recording
device in the requested format; sceAudioInInput returns one grain of
captured samples, padded with silence when the device falls behind and
keeping at most four grains of latency. Without a recording device a
port reports DEVICE_NONE in sceAudioInGetSilentState and delivers
silence at its sample rate.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:37:09 +02:00
Dean cd61f15e55
Merge pull request #470 from adriadam10/perf/validate-program-flat-index
perf(shader): index ValidateProgram by value and block id
2026-10-04 19:24:04 +13:00
Adrià Franch 01bae4dd79 fix(shader): track the multi-register destinations of the quad SAD ops in vertex fetch analysis
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:23:37 +02:00
Adrià Franch f9a074250f feat(shader): implement v_qsad_pk_u16_u8 and the mqsad ops
Decode VOP3 0x172, 0x173 and 0x175. Each op slides a 4-byte window over the
64-bit src0 and adds the byte SAD against src1 to the matching 16-bit
(pk_u16) or 32-bit (mqsad_u32) field of src2; the mqsad forms skip zero
reference bytes. Sums wrap per field, as measured on RDNA2 hardware.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:22:25 +02:00
Adrià Franch d43a5487ca docs: SHA-256 memory operands now relink except RIP-relative ones
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:22:02 +02:00
Adrià Franch 5fc16a9548 feat(relinker): lower SHA-256 instructions with a memory operand
SHA256RNDS2/MSG1/MSG2 with a memory source made `--to-intel` fail the
whole relink. The stub now spills a scratch xmm, loads the operand into
it with MOVDQU (AMD does not fault on a misaligned SHA operand, so the
unaligned load keeps that behaviour) and runs the register-form
lowering. RSP-based operands get the spill depth added to their
displacement. RIP-relative operands still fail: the stub runs at a
different address.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:21:40 +02:00
Adrià Franch 13ac232520 fix(shader): count ds_permute_b32 as a lane source
With uniform inputs every lane writes to the same target lane, so only
that lane receives the value; the two-lane wave64 path must not share it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:21:33 +02:00
Adrià Franch dbb76aa511 feat(shader): implement ds_permute_b32
ds_permute_b32 is the forward (scatter) counterpart of ds_bpermute_b32:
every active lane sends its data to lane ((addr + offset) >> 2) & 31 of
its wave. As measured on hardware, the highest sending lane wins, an
active lane nobody writes to gets 0 and inactive lanes neither send nor
receive. It lowers to one shuffle of the data, address and EXEC bit per
source lane, using the same wave base as ds_bpermute_b32.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:19:43 +02:00
Adrià Franch 5c09d039bb perf(shader): index ValidateProgram by value and block id
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:18:51 +02:00
Dean 870bdd814f
Merge pull request #373 from MichonGoddijn231849/fix/replaced-device-shadows
fix(agc): a replaced device's unit shadows leave the registry
2026-10-04 18:49:42 +13:00
Dean a874079ac6
Merge pull request #422 from MichonGoddijn231849/perf/graphics-failure-memo
perf(agc): memoize source failures of draw stages as for compute
2026-10-04 18:49:25 +13:00
Dean 50eafda4ce
Merge pull request #424 from MichonGoddijn231849/perf/template-rebind-moved-buffers
perf(agc): draw templates rebind moved read-only buffers and data words
2026-10-04 18:49:08 +13:00
Dean 7b64e262d8
Merge pull request #427 from RomainROCH/codex/fix-wide-string-precision
fix(libc): count wide string precision in output characters
2026-10-04 17:50:53 +13:00
Dean 2e9da3f0fa
Merge pull request #350 from QDarkRex/fix/relinker-windows-icon
fix(relinker): add icons to generated Windows executables
2026-10-04 17:50:37 +13:00
RomainROCH a35e0cfc84 test(relinker): register segment coverage beside load alignment checks 2026-10-04 05:59:16 +02:00
Dean 8f1957623b
Merge pull request #463 from oneandonlydean/perf/agc-occlusion-dumps-on-gpu
perf(agc): record occlusion counter dumps on the GPU
2026-10-04 16:39:08 +13:00