Commit Graph
557 Commits
Author SHA1 Message Date
Dean 296b1ac934 Merge pull request #15795 from Pipodi/perf/shader-fault-check-dedup
perf(shader): skip fault checks dominated by the same check
2026-11-05 08:18:59 +13:00
Dean 020377bf9b Merge pull request #14265 from Astronaut10/perf/shader-vertex-specialized
perf(shader): emit vertex modules specialized instead of in registration form
2026-11-05 08:18:17 +13:00
Dean f8a6fb14fb Merge pull request #8458 from TheSovietWaffle/test/shader-mul-lo-u16-negated
fix(shader): keep 24-bit factor reads that a negating xor feeds into a multiply
2026-11-05 06:34:07 +13:00
Alex ColliniandClaude Opus 5.5 6aee0ff2a4 perf(shader): skip fault checks dominated by the same check
An invalid-descriptor fault check of a GPU-descriptor buffer access, and the
swizzle-selector check of a formatted load, is not emitted when an identical
check on the same descriptor under the same execution guard sits earlier in
the same IR block or in a dominating block. The fault record, the invocation
stop and the host error stay the same; only the pc stored for a fault that two
invocations race to record can differ. APS5_NO_FAULT_CHECK_DEDUP restores every
check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 15:00:27 +01:00
Dean a9a6ae8ad6 Merge pull request #14627 from AlexWhitehouse/feat/shader-f64-clamp-keeps-nan
feat(shader): keep NaN through f64 result clamp when DX10_CLAMP is clear
2026-11-04 21:32:18 +13:00
Dean 5efe8f6520 Merge pull request #7223 from yabanana/feature/nested-resource-tables
feat(shader): resolve nested image tables through runtime pointers
2026-11-04 16:57:51 +13:00
Dean 2fde02c401 Merge pull request #15362 from beardsciences/perf/mesh-window-no-zero-fill
perf(shader): stop zeroing mesh window buffer slots at workgroup start
2026-11-04 08:13:10 +13:00
Dean 6eb5665c38 Merge pull request #15287 from AlexWhitehouse/feat/shader-sdwa-int-to-f32-destinations
feat(shader): accept SDWA destination selects on v_cvt_f32_i32 and v_cvt_f32_u32
2026-11-04 08:12:34 +13:00
Dean 6cd2899cc6 Merge pull request #15244 from AlexWhitehouse/feat/shader-sdwa-integer-bitscan-destinations
feat(shader): accept SDWA destination selects on integer bit scans and bfrev
2026-11-04 08:11:55 +13:00
Dean b11031f512 Merge pull request #15155 from Pipodi/perf/spanned-ballot-one-barrier
perf(shader): build a spanned wave's ballot from the native subgroup ballot
2026-11-04 08:11:28 +13:00
Dean 0e7df59efb Merge pull request #11557 from JAB-dev/feat/agc-staged-packed-partial-writes
feat(agc): draw partial writes of multisampled 4_4_4_4 targets into a temporary target
2026-11-04 08:10:52 +13:00
Dean Galvin 635f569fea Merge main 4f41f4c375 into #7223 (7f36e41c45)
Conflicts resolved:
- libSceAgcDriver CMakeLists.txt: main moved test registration into tests/cmake/<exe>.cmake (tools/agc_test_split.py resolve); this branch's nested image table tests now sit in agc_driver_image_table_tests.cmake, and its nested snapshot retry test sits next to main's descriptor phis test in agc_shader_memory_tests.cmake.
- ResourceMaterializer.cpp: table equality compares both this branch's nested/pointers and main's resourceViews; the footprint counts main's resource views and this branch's pointers.
- ShaderDiskCache.cpp: both sides grew the descriptor source record (this branch: TableColumn::buffer, 1 byte; main: requiredBlocks, an 8-byte count), so the decoder minimum is 72 + 1 + 8 = 81, and the field-count asserts are DescriptorSource 4 and TableColumn 19.
- ShaderDiskCache.hpp: FormatVersion 56, an unclaimed number (main has 52; 53, 54 and 55 are already set by other open PRs).
- ResourceMaterializer.cpp (semantic, no text conflict): main added the per-image resourceViews loop to Snapshot(source, table), and it uses the top-level table index; this branch moved that copying into CopyRecords(), which nested tables share and which has no table index. The loop now runs in Snapshot right after CopyRecords, as on main; nested tables carry no resource views, as before.
2026-11-04 04:43:38 +13:00
fma-rc d7018a97af docs(shader): shorten the 3D gather debt entry to the 1,000-character guideline 2026-11-03 12:37:05 +01:00
fma-rc 696e9fa202 docs(shader): record the measured 3D gather addressing in the shader debt 2026-11-03 12:37:05 +01:00
JAB-dev 1b12e6f302 Merge remote-tracking branch 'origin/main' into feat/agc-staged-packed-partial-writes
# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
2026-11-03 10:29:50 +02:00
Dean 81605d59ec Merge pull request #12132 from mrfelek/fix/descriptor-web-lane-index
fix(shader): fold descriptor web paths that hold the lane index or texels
2026-11-03 21:10:04 +13:00
Dean 66387a10ee Merge pull request #10000 from EagleBearerYS/feat/shader-sampler-limits
feat(shader): raise the sampler and sampled-pair limits past the 32-bit sampler masks
2026-11-03 21:09:43 +13:00
Dean 99bf42af86 Merge pull request #9671 from ntamas94/up/gcn-cmpx-writes-destination
fix(shader): write a GCN v_cmpx result to its VCC or SDST as well as EXEC
2026-11-03 21:09:21 +13:00
Dean 20f515312c Merge pull request #10556 from mixyt/fix/unset-format-null-textures
fix(shader): decode a T# with an unset format field as null
2026-11-03 21:08:38 +13:00
Dean a9e723b83b Merge pull request #14909 from kallmek3nny/feat/shader-alpha-to-coverage-sample-mask
feat(shader): combine alpha-to-coverage with a sample-mask export
2026-11-03 18:12:13 +13:00
Dean b8b15a36ca Merge pull request #14888 from kallmek3nny/feat/shader-sdwa-f16-byte-clamp
feat(shader): support SDWA clamp with byte selectors on f16 VOP2
2026-11-03 18:11:43 +13:00
Alex ColliniandClaude Opus 5.5 dba107a8bb docs(debt): say where the spanned ballot's title runs were made
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 01:00:34 +01:00
Alex Collini 012c6475f0 Merge main 5cb015caaa into #15155 2026-11-03 01:00:33 +01:00
Christian 9642972a8b perf(shader): stop zeroing mesh window buffer slots at workgroup start 2026-11-02 18:56:44 -05:00
felek b5f1d6b44d docs(debt): say which image results a descriptor web fold takes
The descriptor web entry and APS5_STRICT_DESCRIPTOR_WEBS said "texels";
the fold takes image loads and samples only. A path through an image
gather or an image atomic's returned value still throws.

AI-assisted.
2026-11-02 23:58:12 +01:00
Dean a5c53e975c Merge pull request #12980 from Gonic0/fix/agc-min-lod-pinned-level
fix(agc): bind a T# minimum LOD through an S# that holds the LOD at 0
2026-11-03 11:35:28 +13:00
Dean 1f272537eb Merge pull request #12764 from Pipodi/perf/flat-private-aperture-1028
perf(recompiler): back compute scratch with a device buffer slot pool
2026-11-03 11:35:12 +13:00
Alex WhitehouseandClaude Opus 5.5 c8f01b91b4 feat(shader): accept SDWA destination selects on v_cvt_f32_i32 and v_cvt_f32_u32
Allow byte and word SDWA destinations, with every source select, on
v_cvt_f32_i32 and v_cvt_f32_u32. The source is selected and extended,
converted once, and the low byte or word of the f32 bit pattern is placed
with DST_UNUSED pad, sign-extend or preserve (RDNA2 ISA 12.8 opcodes 5-6,
6.8 and 13.3.7 Table 88; LLVM 19.1.0 VOP1Instructions.td L288-L289 and
SIPeepholeSDWA.cpp destination folding).

On an NVIDIA RTX 3060 (driver 610.88), OpConvertUToF of an
OpBitFieldSExtract result converts the field as signed, so v_cvt_f32_u32
with a SEXT byte or word source whose top bit is set is wrong there for
any destination, already on main. Record it in shader debt, and test SEXT
on v_cvt_f32_u32 only with the top bit clear.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 22:27:57 +00:00
Alex WhitehouseandClaude Opus 5.5 cbe3fde891 feat(shader): accept SDWA destination selects on integer bit scans and bfrev
Allow byte and word destinations for v_ffbh_u32, v_ffbl_b32,
v_ffbh_i32 and v_bfrev_b32 through the existing SDWA translation path.
Check every source select, extension and partial destination mode against
a CPU model in wave32 and wave64 execution tests.

Sources: AMD RDNA2 ISA sections 6.8, 12.8 (opcode 59) and 13.3.7
Table 88; LLVM 19.1.0 VOP1Instructions.td lines 347-351 and 1194-1197,
and SIPeepholeSDWA.cpp destination folding. PS5 gfx1013 is unmeasured.

Lavapipe with validation: main rejects the new forms; both focused cases
and all ten SDWA tests pass with the change. Forcing source extraction
to zero-extend fails both new cases; restoring it passes. Conventions pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 21:34:25 +00:00
Dean 9090972b7e Merge pull request #15172 from brumskysb/docs/div-scale-f64-rdna2
docs(shader): record `v_div_scale_f64` denormal modes on RDNA2
2026-11-03 09:24:32 +13:00
JAB-dev 3ffeb212b0 Merge remote-tracking branch 'origin/main' into feat/agc-staged-packed-partial-writes 2026-11-02 22:06:50 +02:00
Dean 096c45570f Merge pull request #15161 from brumskysb/docs/fma-f64-tininess
docs(shader): record `v_fma_f64` and `v_div_fmas_f64` on RDNA2
2026-11-03 08:55:54 +13:00
Dean f7d225d8e3 Merge pull request #15118 from shahulmubeen-a/docs/shader-hull-quad-lane-masks
docs(shader): record why hull programs that read a whole-quad lane mask throw
2026-11-03 08:53:37 +13:00
brumskysb 3d7ba8c931 docs(shader): record v_div_scale_f64 denormal modes on RDNA2 2026-11-02 12:53:14 -07:00
Dean aeae1aebe7 Merge pull request #15117 from shahulmubeen-a/docs/shader-integer-linear-point
docs(shader): record that RDNA2 point-samples integer T#s under a bilinear S#
2026-11-03 08:53:01 +13:00
Dean 886ddf2050 Merge pull request #15116 from shahulmubeen-a/docs/shader-format-131-layout
docs(shader): record the measured layout of T# FORMAT 131
2026-11-03 08:52:28 +13:00
brumskysb fa87e7a722 docs(shader): record v_fma_f64 and v_div_fmas_f64 on RDNA2 2026-11-02 12:31:12 -07:00
Cesar MoraandClaude Opus 5.5 94fae013aa perf(shader): emit vertex modules specialized instead of in registration form
In registration form a vertex module decodes the V# stride, swizzle,
bounds mode and format of every vertex buffer load at run time. Vertex
artifacts are now emitted specialized, as one above
registrationWordLimit already was; pixel artifacts keep registration
form. A vertex stage's pre-rasterization library is built at its first
draw instead of at registration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015W3M6NbYpmwWkzkL8YNLaF
2026-11-02 12:44:12 -06:00
Alex ColliniandClaude Opus 5.5 6b95a80202 perf(shader): build a spanned wave's ballot from the native subgroup ballot
Each invocation stores its host subgroup's native ballot word into a
separate wave_ballot array and one barrier replaces the previous three.
A private parity counter alternates two slot pairs so a ballot never
overwrites words a slower invocation is still reading. Offline NVIDIA
compiles of captured wall shaders were 15-24 % faster.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 19:27:00 +01:00
brumskysb 2f101ee4a0 docs(shader): record negative texture coordinates on RDNA2 2026-11-02 10:23:56 -07:00
mixyt 0dd1814129 fix(shader): decode a T# with an unset format field as null 2026-11-02 15:28:18 +00:00
Nicolas GonzalezandClaude Opus 5.5 4e2a028e43 fix(agc): bind a T# minimum LOD through an S# that holds the LOD at 0
Without VK_EXT_image_view_min_lod, a T# clamp paired with an S# that
holds the LOD at 0 (no mip filter or MAX_LOD 0) threw, since the shader's
MinLod would sit above the sampler's maximum. The view clamp then reads
the clamp's level with the magnification filter, so such an S# is now
bound with MIN_LOD = MAX_LOD = the clamp, its mip filter kept (none
becomes point) and its magnification filter for both.

The builder still throws when that S# has different magnification and
minification filters (the view clamp leaves the LOD at 0 and the variant
raises it to the clamp, and AMD RDNA 4 and NVIDIA disagree on the view
clamp's choice), filters anisotropically in only one direction, or also
samples a table image or a mipmapped image with another clamp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 11:58:37 -03:00
Nicolas GonzalezandClaude Opus 5.5 fe18496c95 feat(agc): apply a T#'s MIN_LOD clamp in the shader without VK_EXT_image_view_min_lod
MoltenVK has no VK_EXT_image_view_min_lod, so since #130 the first T#
with a MIN_LOD clamp above its base level threw. ASTRO BOT (PPSA21564
01.007.000) hits it on the title screen, about four minutes after boot.
MoltenVK does offer shaderResourceMinLod, which maps the SPIR-V MinLod
operand to Metal's min_lod_clamp.

On a device with shaderResourceMinLod, without the extension and
without graphics pipeline libraries, the new target flag
shaderImageMinLod moves the clamp into the shader:

- DescriptorBindingBuilder writes each direct image's clamp, relative
  to the view's base level and bounded by its last level and MAX_MIP,
  as a float specialization constant at MinLodBase + image.
- Samples of direct images take it as the MinLod operand, or as an FMax
  on an explicit LOD when the clamp is above 0, combined with an
  instruction's _cl clamp.
- The image view no longer chains the clamp there; image table entries
  with a clamp are still rejected, and devices with the extension are
  unaffected. APS5_NO_IMAGE_VIEW_MIN_LOD forces the shader lane.
- It throws when the clamp sits above a paired S#'s MAX_LOD or has no
  mip filter, follows an explicit LOD or gradient with a nonzero S# LOD
  bias, pairs with a run-time S# or different min and mag filters, or
  meets image_get_lod, gathers at a clamp of a level or more, or the
  emulated depth-compare or 11:11:10 sample.
- ValidateShaders accepts CapabilityMinLod when the device enables
  shaderResourceMinLod.
- The flag is written after hostInterpolationFirst as request
  serialization version 53; older versions read it as false.

The gaps, including llvmpipe applying the S# bias after the clamp, are
recorded in docs/dev/debt/shader.md.

Tested on an M-series Mac (MoltenVK 1.4.2, x86_64 under Rosetta):
image_sample_lod_clamp samples a T# with fractional and level clamps
over BASE_LEVEL 0 and 1 in both lanes, and fails without the shader
clamp or with an absolute one; graphics, shader disk cache, shader
memory and request serializer tests pass. PPSA21564 renders the title
and reaches the warp sequence after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 11:58:37 -03:00
Dean Galvin e9d8998d58 Merge main 3c3b3cda73 into #12764 (fee187ee67)
SpirvEmitter.cpp: main now calls Finalize() before filling info and checks
spanned-wave barriers on the words; keep that and run this branch's
VerifyScratchPoolReturns(state, words) on the same words before returning.
2026-11-02 23:39:24 +13:00
Dean d2ce337078 Merge pull request #11580 from QRMOE/fix/shader-converted-image-d16
fix(shader): load and store 16-bit data of converted packed images
2026-11-02 23:29:11 +13:00
Dean fe06bfea1d Merge pull request #11510 from morten-holm/feat/shader-buffer-or64-split
feat(shader): split unused-result 64-bit bitwise buffer atomics without shaderBufferInt64Atomics
2026-11-02 23:28:53 +13:00
Dean 1900d3963a Merge pull request #10941 from TechLevelZero/fix/div-fmas-f32-single-rounding
fix(shader): round v_div_fmas_f32 once and keep its denormal inputs
2026-11-02 23:25:23 +13:00
Dean f2bb268d70 Merge pull request #10858 from maximilianfv/fix/agc-moltenvk-wave-lds-memory-barriers
fix(agc): order wave LDS accesses with memory barriers on MoltenVK
2026-11-02 23:24:42 +13:00
Dean 18bb046f69 Merge pull request #7922 from ThatsLeo/feat/shader-spanned-uniformity
perf(shader): span single-wave wave64 compute by default after a uniformity check
2026-11-02 23:22:27 +13:00
Yunus Shaikh 760a550294 Merge main into feat/shader-sampler-limits
# Conflicts:
#	core/shader/recompiler/ShaderDiskCache.hpp
2026-11-02 00:48:24 -08:00