Commit Graph
14017 Commits
Author SHA1 Message Date
Adrià FranchandClaude b5da7d00e4 fix(shader): apply the f32 output modifier on the bits like the hardware
Co-Authored-By: Claude <[email protected]>
2026-10-05 05:00:29 +02:00
Adrià FranchandClaude e58e2f0605 feat(shader): accept float modifiers on v_cndmask_b32, v_mul_legacy_f32 and v_ldexp_f16
- v_cndmask_b32: neg/abs on DPP; neg/abs applied on the bits, as the hardware does
- v_mul_legacy_f32: neg/abs on DPP and SDWA, clamp/omod on SDWA and VOP3
- v_ldexp_f16: neg/abs on src0 for VOP3, DPP and SDWA; NaN result chosen on the bits

Co-Authored-By: Claude <[email protected]>
2026-10-05 04:59:40 +02:00
Adrià FranchandClaude a15a21c2c6 feat(shader): implement clamp on v_mad_u64_u32 and v_mad_i64_i32
Co-Authored-By: Claude <[email protected]>
2026-10-05 04:59:15 +02:00
Adrià FranchandClaude aff00b8cde fix(shader): wave-wide exec and vcc branch conditions
s_cbranch_execz/execnz/vccz/vccnz test the whole wave mask on hardware,
but the single-lane path branched on each lane's own bit, so inactive
lanes took the other side and diverged in scalar state. Branch on a
wave ballot instead, and execute the untested SOPP ops (cdbg branches,
s_clause, s_inst_prefetch, s_setprio, s_waitcnt_depctr, s_ttracedata)
against values measured on hardware.

Co-Authored-By: Claude <[email protected]>
2026-10-05 04:56:35 +02:00
Dean 00407df8a9 Merge pull request #585 from Raghav314/feat/ajm-batch-job-queries
feat(ajm): implement DecodeSingle, GetGaplessDecode and GetCodecInfo
2026-10-05 15:54:58 +13:00
Dean 7dcbc18182 Merge pull request #601 from nicolasabosch/test/pixel-lds-pipeline-statistics
test(agc): validate pixel LDS and expose pipeline statistics
2026-10-05 15:52:43 +13:00
Dean 0bd711b13b Merge pull request #599 from adriadam10/test/tbuffer-d16-xyzw
test(shader): execute tbuffer_load_format_d16_xyzw against hardware results
2026-10-05 15:52:02 +13:00
Dean 912f43670c Merge pull request #598 from adriadam10/test/buffer-atomic-x2-leftovers
test(shader): execute buffer_atomic_or_x2 and buffer_atomic_swap_x2 against hardware results
2026-10-05 15:51:20 +13:00
Dean 352c6acf4b Merge pull request #597 from adriadam10/test/flat-d16-loads
test(shader): execute the flat D16 loads against hardware results
2026-10-05 15:51:10 +13:00
Dean f8a3211cea Merge pull request #522 from adriadam10/fix/dpp16-no-form
fix(shader): refuse DPP16 on opcodes with no DPP form
2026-10-05 15:50:28 +13:00
Dean 6d23390ac7 Merge pull request #513 from adriadam10/feat/dpp8
feat(shader): decode DPP8 on VOP1 and VOP2
2026-10-05 15:49:47 +13:00
Dean adac06b59b Merge pull request #474 from adriadam10/feat/div-f64
feat(shader): implement v_div_scale_f64, v_div_fmas_f64 and v_div_fixup_f64
2026-10-05 15:49:04 +13:00
Dean bd06241645 Merge pull request #447 from adriadam10/feat/vop3-f64-rest
feat(shader): implement v_rcp/rsq/sqrt_f64 and v_trig_preop_f64
2026-10-05 15:48:23 +13:00
Dean 9121886b0d Merge pull request #436 from adriadam10/feat/sopp-smem-misc
feat(shader): decode the s_endpgm variants, s_round_mode and SMEM probe/discard
2026-10-05 15:47:41 +13:00
Adrià FranchandClaude c0a98e3a6a fix(shader): refuse s_setpc_b64 after s_sub with the immediate first
Co-Authored-By: Claude <[email protected]>
2026-10-05 04:45:57 +02:00
Adrià FranchandClaude 9edb57d6b5 fix(shader): keep v_permlane16 lanes whose source lane is inactive
Without fetch-inactive or bound_ctrl, a v_permlane16_b32/v_permlanex16_b32
lane whose source lane is inactive keeps its old value on hardware;
AnyPS5 wrote 0 there. bound_ctrl alone now writes 0.

Co-Authored-By: Claude <[email protected]>
2026-10-05 04:38:40 +02:00
Adrià FranchandClaude c97030cc7b test(shader): execute ds_swizzle_b32 in all three offset modes
Co-Authored-By: Claude <[email protected]>
2026-10-05 04:34:00 +02:00
Adrià FranchandClaude 47b71dbaa4 fix(shader): return zero when an s_buffer_load offset passes 2^32
The byte address of each dword of s_buffer_load (soffset + imm + 4*i)
was computed in 32 bits, so a sum past 2^32 wrapped around and read the
start of the buffer. On hardware the sum doesn't wrap: such dwords are
out of range and read 0, like any dword at or past num_records. Both the
bound V# path and the GPU-computed V# path now check the carry.

The new execution test runs s_buffer_load_dwordx4/x16 and
s_load_dwordx16 against values captured on hardware.

Co-Authored-By: Claude <[email protected]>
2026-10-05 04:29:33 +02:00
Nicolas Abosch aa08977a59 fix(libc): preserve 64-bit long integer conversions 2026-10-04 23:27:17 -03:00
NumberGuan 75f407b926 fix(relinker): discover bundled modules in prx directories
Preserve each bundled module directory under app0 and resolve Linux dependencies across directories. Add integration coverage for both output formats and Windows startup. Refs #556; duplicate-export rejection remains unchanged.
2026-10-04 23:22:50 -03:00
hamb3r 86e5ae5cdb test(avplayer): apply texture limits to active buffers 2026-10-05 05:13:21 +03:00
hamb3r bb165d2ab4 test(avplayer): preserve texture allocation accounting 2026-10-05 05:06:36 +03:00
Nicolas Abosch e08333825f test(agc): validate pixel LDS and expose pipeline statistics 2026-10-04 23:04:39 -03:00
Adrià FranchandClaude f1a3507e90 test(shader): execute tbuffer_load_format_d16_xyzw against hardware results
Co-Authored-By: Claude <[email protected]>
2026-10-05 04:01:05 +02:00
hamb3r cf10b5e609 fix(avplayer): make decode-ahead buffers optional 2026-10-05 04:58:00 +03:00
Adrià FranchandClaude 9f7d1bfa98 test(shader): execute buffer_atomic_or_x2 and buffer_atomic_swap_x2 against hardware results
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:54:49 +02:00
Adrià FranchandClaude b4151114a1 test(shader): execute the flat D16 loads against hardware results
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:50:30 +02:00
Adrià FranchandClaude a4482e0b71 fix(shader): compute v_cvt_pknorm_*_f32, v_ldexp_f32 and v_pack_b32_f16 on the bits
v_pack_b32_f16 applied neg/abs to bit 31 of the source dword instead of the
selected half. v_cvt_pknorm_{i16,u16}_f32 and v_ldexp_f32 used GLSL
PackSnorm2x16/PackUnorm2x16/Ldexp, which leave NaN, rounding ties and
denormals to the driver. Compute them on the bits as measured on RDNA2.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:42:08 +02:00
Adrià FranchandClaude 559aeac8ec fix(shader): read _cd quad gradients through a lane-varying permute
ReadLane counts as a wave-uniform source, so the two-lane wave64 path
shared the first half's gradients with lanes 32 to 63. The test also
runs every case as wave64 with different quads in the upper half.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:39:58 +02:00
Adrià FranchandClaude 6138494928 feat(shader): implement image_sample_cd/_g16 variants and fix a16 gradient layout
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:39:58 +02:00
MichonandClaude Opus 5.5 e18d4292a2 fix(shader): decode image_sample_cd as a derivative sample
image_sample_cd takes its derivatives in the image_sample_d address
layout; only the hardware LOD selection differs (one LOD per quad instead
of per pixel). The decoder refused it. It now samples with the given
gradients per lane, which matches whenever the lanes of a quad pass equal
derivatives.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-05 03:39:39 +02:00
Adrià FranchandClaude f3b74e2cef fix(shader): choose unary f32/f16 special results on the bits, as RDNA does
v_ceil/floor/trunc/rndne/fract/sqrt/rsq/rcp/rcp_iflag/log/exp/sin/cos
(f32 and f16) and v_frexp_mant_f32 left NaN, invalid, zero and infinite
results to the driver: signalling NaNs came back unquieted, lavapipe lost
the NaN sign and payload, invalid results were +NaN instead of -NaN, f32
sin/cos at whole and half cycles returned tiny values instead of +0, and
v_fract_f16 of a tiny negative rounded up to 1.0.

Adds an execution test for the 27 opcodes with expected values from
hardware; approximate ops are compared with tolerances from the Vulkan
precision table.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:38:12 +02:00
Adrià FranchandClaude 6686bff493 test(shader): compare f16 sine results within the Vulkan error bound
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:38:07 +02:00
Adrià FranchandClaude 30fdc07cd5 test(shader): accept any NaN where the driver picks the f16 result payload
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:38:07 +02:00
Adrià FranchandClaude b94b1f96dc fix(shader): apply clamp but not omod to f16 results, as RDNA does
writeF16 dropped the clamp bit, so VOP3/SDWA f16 results with clamp
(v_rcp_f16, v_fma_f16, v_cvt_f16_f32, v_add_f16_sdwa, ...) were not
saturated. Clamp now limits to [0, 1] with NaN and -0 going to +0.
The f16 sqrt/rsq/log and sin/cos paths applied omod, which the
hardware ignores on f16 results in the default float mode, and
v_cvt_pkrtz_f16_f32 applied clamp and omod to its inputs, which the
hardware ignores as well.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:38:07 +02:00
Adrià FranchandClaude 063437cdcd feat(shader): implement v_div_scale_f64, v_div_fmas_f64 and v_div_fixup_f64
These make up the precise f64 division macro compilers emit for a / b.
Like the f32 ops, the rules were measured on an RDNA2 GPU (41152 rows,
model matches all of them):
- div_scale decides from the exponent fields only: 2^128 or 2^-128
  scaling and VCC for differences >= 768 or <= -768, a denormal or huge
  (>= 2045) denominator and a numerator exponent <= 53; a NaN source is
  passed through unchanged and a zero input gives 0xfff8000000000000.
- div_fmas scales by 2^128 when the exponent of S2 is >= 1024, else
  2^-128, before the single rounding, so it reuses the exact fma
  emulation with the scale folded into its final rescale.
- div_fixup follows the ISA: NaN sources are quieted, a NaN quotient
  with finite inputs becomes +-inf, exponent differences below -1075
  give a signed zero.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:37:13 +02:00
Adrià FranchandClaude 4f901b9a77 feat(shader): implement v_rcp/rsq/sqrt_f64 and v_trig_preop_f64
Decode and translate the remaining unary f64 transcendentals and
v_trig_preop_f64.

On RDNA2 hardware v_rcp_f64, v_rsq_f64 and v_sqrt_f64 are approximations
(relative error up to ~2^-24.3 over 8209 inputs; sqrt(1.0) is not even
exact), so they are emitted as exact double operations and the test
compares against the hardware value with a 2^-23 tolerance. Special
cases are exact and selected on bits: NaN inputs are quieted (RADV keeps
signaling NaN on FDiv), negative inputs give the default NaN
0xfff8000000000000, rsq(-0) = -inf, sqrt(-0) = -0.

v_trig_preop_f64 matches the hardware bit for bit on 24627 results plus
a sweep of the table tail: the 2/PI table is 1184 bits (bits below b17
read as zero), shift = 53 * S1[4:0] + max(exp - 1077, 0), +128 scale for
exp >= 1968, omod ignored. The 53-bit window is read from a private u32
table and scaled in two exact steps so only the final multiply rounds.

Stacked on the f64 infrastructure of #446.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:36:14 +02:00
Adrià FranchandClaude 36c2fa4ffe fix(shader): translate s_round_mode only for round to nearest even
Any other mode throws instead of being a silent no-op.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:34:37 +02:00
Adrià FranchandClaude 69e2d801d1 feat(shader): decode the s_endpgm variants, s_round_mode and SMEM probe/discard
s_endpgm_saved and s_endpgm_ordered_ps_done end the wave like s_endpgm
(checked on an RDNA2 GPU: nothing after them runs), so they decode to
SEndpgm and the control flow graph treats them as terminators.
s_atc_probe, s_atc_probe_buffer and s_dcache_discard(_x2) have no visible
effect and translate to no-ops like the other scalar cache controls.
s_round_mode is ignored like s_setreg MODE writes; listed in TechnicalDebt.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:34:37 +02:00
Adrià FranchandClaude 12befda5cf fix(shader): refuse DPP16 on opcodes with no DPP form
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:33:06 +02:00
Adrià FranchandClaude fd159a63b0 fix(shader): DPP16 lanes whose source lane is inactive
Without bound_ctrl and fetch-inactive, a DPP16 lane whose source lane is
inactive keeps its old value instead of being written with 0. With
fetch-inactive, a source outside the row reads 0.

Co-Authored-By: Claude <[email protected]>
2026-10-05 03:32:41 +02:00
Adrià FranchandClaude 391eb6ffe8 feat(shader): decode DPP8 on VOP1 and VOP2
Co-Authored-By: Claude <[email protected]>
2026-10-05 03:32:30 +02:00
Dean ebf29f8d91 Merge pull request #595 from NahuelGenchi/fix/fma-legacy-dx9-zero
fix(shader): apply the DX9 zero rule to v_fma_legacy_f32
2026-10-05 14:32:00 +13:00
Dean 8a0efb6338 Merge pull request #589 from hamb3r/fix/windows-dpi-awareness
fix(video): set per-monitor v2 DPI awareness on Windows
2026-10-05 14:31:18 +13:00
Dean bc0726c486 Merge pull request #583 from DiulioAires/fix/bytewriter-bounds
fix(relinker): check byte writer bounds
2026-10-05 14:30:37 +13:00
Dean 70596d78eb Merge pull request #577 from CnRJay/feat/s-getreg-mode
feat(shader): implement s_getreg_b32 for the MODE round mode fields
2026-10-05 14:29:24 +13:00
raghav314 77e2fe1322 docs(ajm): record where the codec info and gapless values come from 2026-10-05 06:58:23 +05:30
Dean 13e0afcc00 Merge pull request #576 from CnRJay/feat/vop-legacy-fma-dot2
feat(shader): implement v_dot2_f32_f16
2026-10-05 14:27:40 +13:00
Dean 359aa37233 Merge pull request #594 from DotDebian/feat/shader-buffer-atomic-csub
feat(shader): implement buffer_atomic_csub
2026-10-05 14:25:56 +13:00
Dean 60b6cfc173 Merge pull request #590 from CnRJay/fix/agc-thread-local-teardown
fix(agc): free per-thread driver state at thread exit without emutls
2026-10-05 14:25:46 +13:00