Commit Graph
483 Commits
Author SHA1 Message Date
Yunus Shaikh 2848253fe4 Merge main into fix/recompiler-once-per-pixel-sample-inputs 2026-10-17 19:06:51 -07:00
milescovielloandClaude Opus 5.5 6c47f92b52 fix(shader): pass clip distances through the rect-list stages as the vertex shader writes them
The recompiled vertex shader writes gl_ClipDistance through a variable of
its own beside its position block, but the rect-list control and
evaluation stages read and wrote it as a second member of their
per-vertex block, so the stage interfaces did not match
(VUID-RuntimeSpirv-OpVariable-08746). They now take and forward the clip
distances through ClipDistance variables of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 00:43:33 +00:00
Yunus Shaikh ddf072e6f3 Merge main into fix/recompiler-once-per-pixel-sample-inputs
Main's EmitSetAttribute debt entry now says the generated rect-list and
barycentric tessellation stages forward the vertex shader's clip array.
It sits next to this branch's PERSP_SAMPLE and pixel position entries,
which main left as they were; keep main's entry and this branch's two.
2026-10-17 17:03:27 -07:00
Dean 54c5eff8ac Merge pull request #7308 from DavidSamir/feat/shader-barycentric-tessellation
feat(shader): emulate barycentrics through tessellation on devices without geometry shaders
2026-10-18 12:57:13 +13:00
Dean cfaba870d1 Merge pull request #7207 from gjonn/fix/agc-color-11-11-10-float
feat(agc): implement 11_11_10 float color targets through 32-bit uint attachments
2026-10-18 12:08:54 +13:00
Dean 55f82fee83 Merge pull request #7044 from AlxcBTW/pr/dispatch-move
perf(agc): serve compute dispatches whose read-only buffers moved from the cached template
2026-10-18 11:44:09 +13:00
David a968198710 Merge remote-tracking branch 'origin/main' into feat/shader-barycentric-tessellation
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
#	docs/dev/debt/shader.md
2026-10-18 02:30:39 +04:00
Dean e67bb9f034 Merge pull request #7274 from MarcZX100/codex/diagnose-mipmapped-3d-color-refusal-7260
chore(agc): report unsupported 3D mip target state
2026-10-18 11:18:29 +13:00
David 48b7d3a34d test(agc): cover the tessellation route of the barycentric emulation 2026-10-18 02:16:51 +04:00
Dean e391cf7077 Merge pull request #6614 from MarcZX100/codex/lvp-descriptor-recycling-6608
fix(agc): free released lavapipe descriptor sets
2026-10-18 10:30:35 +13:00
Gjon Gojcevic 45c78bb880 test(agc): refuse an additive blend into an 11_11_10 float target
The blend-refusal case used CB_BLEND_CONTROL 0x60010001, which is
ONE * source + ZERO * destination: a replace blend that writes the source
unchanged. A packed target can draw such a blend with blending disabled,
so the case now uses the additive blend 0x60010101, which a packed target
must still refuse.

AI-assisted: yes
2026-10-17 17:29:22 -04:00
Gjon Gojcevic a518a90ad6 fix(agc): refuse rounding 11_11_10 float targets and resolves of packed color targets
An 11_11_10 float color target with CB_COLOR_INFO ROUND_MODE (bit 18) clear
asks the CB to round, but the export packing truncates toward zero, so such a
target now throws. A CB resolve whose source is a packed 10_11_11 unorm or
11_11_10 float target would resolve the raw R32_UINT words, which an integer
resolve cannot average, so it now throws at decode.

AI-assisted: yes
2026-10-17 17:29:21 -04:00
Gjon Gojcevic 49b0e805f0 feat(agc): implement 11_11_10 float color targets through 32-bit uint attachments
Color format 7 (COLOR_11_11_10, float) keeps its 10-bit component in the
low bits; with the reversed component order (COMP_SWAP 2) that is blue,
with red in the high 11 bits. Vulkan has no such layout, so the target was
refused at decode.

Render it the way 10_11_11 unorm targets are rendered: an R32_UINT
attachment, the reversed export mapping 0xc6, and a new
ColorExportPacking::Float11_11_10 that makes the pixel shader pack each
export with the format-43 image store conversion (toward zero, overflow to
the largest finite value, negatives to zero, NaN kept). Blending, partial
writes, 16-bit integer exports, DCC and the other component orders throw.

AI-assisted: yes
2026-10-17 17:29:21 -04:00
Dean 8690d92f07 Merge pull request #7071 from SleglJan/fix/storage-budget-pressure
fix(agc): let the storage image cache budget follow the heap's use like the sampled one
2026-10-18 10:29:01 +13:00
Dean e815fb4170 Merge pull request #7251 from thuanquang/fix/rect-list-last-provoking-vertex
fix(agc): draw rect lists in last provoking vertex mode
2026-10-18 10:28:06 +13:00
Dean cd2dab7b95 Merge pull request #6174 from ee6aba54/fix/agc-texture-cache-reclaim
fix(agc): release the texture caches when a device allocation runs out of memory
2026-10-18 10:24:06 +13:00
Dean 7bea86a633 Merge pull request #7117 from Sam-mon7/fix/pipeline-lazy-buffer-pool
fix(agc): keep cached pipelines across lazy buffer pool creation
2026-10-18 10:18:12 +13:00
MarcZX100 0009388918 chore(agc): report unsupported 3D mip target state 2026-10-17 21:07:00 +00:00
Dean c3c3dcf157 Merge pull request #7213 from thuanquang/feat/color-565-target
feat(agc): render 5_6_5 UNORM color targets
2026-10-18 10:04:00 +13:00
Dean 88395770b8 Merge pull request #6875 from pushkarreddyy/fix/agc-driver-unclamped-normalized-color
fix(libSceAgcDriver): accept unclamped normalized color target formats
2026-10-18 09:55:51 +13:00
thuanquangandClaude Opus 5.5 f2a4236ab6 fix(agc): draw rect lists in last provoking vertex mode
The generated rect-list control stage gave every corner of a rectangle the
flat inputs of its first vertex, so last mode was refused for rect lists.
BuildRectListShaders now also builds a control stage that takes them from
the rectangle's third vertex when the pixel shader has a flat input, and a
draw in last mode uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 02:38:26 +07:00
thuanquangandClaude Opus 5.5 20502c0022 feat(agc): render 5_6_5 UNORM color targets
Goosebumps Terror in Little Creek (PPSA27305) aborts in gameplay with
"unsupported color format 16 number type 0 component swap 2": it renders
into a COLOR_5_6_5 UNORM target. The target now renders into
R5G6B5_UNORM_PACK16. AMD keeps X in bits 0-4 and Z in bits 11-15, and
Mesa's ac_translate_colorswap programs SWAP_STD_REV for a surface with
red in bits 11-15, so with SWAP_STD_REV the exports are written as they
are and with SWAP_STD they are written with X and Z exchanged, as for
1_5_5_5. The alternate swaps and other number types keep throwing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 23:59:26 +07:00
Dextroid17 507032298f test(agc): count mock Vulkan objects atomically 2026-10-17 09:40:55 -04:00
SamandClaude Opus 5.5 86b05a0dc6 fix(agc): keep cached pipelines across lazy buffer pool creation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:08:13 +01:00
Dean 46ba2b91bc Merge pull request #6700 from xXPBSXx/test-agc-depth-copy-format
test(agc): cover the color to depth format mapping of depth compare copies
2026-10-18 00:27:51 +13:00
pushkarreddyy 9fb282064b fix(libSceAgcDriver): accept unclamped normalized color target formats 2026-10-17 16:12:00 +05:30
Jan ŠléglandClaude Fable 5.1 39c23664bd fix(agc): let the storage image cache budget follow the heap's use like the sampled one
StorageTextureBudget gave the storage image cache a quarter of the VK_EXT_memory_budget
budget of the largest device-local heap (capped at TextureCacheBudget, never below 512 MiB)
whatever else the heap held, while SampledTextureBudget takes what that budget leaves after
the heap's other use. On a 10 GB card the storage cache kept 2024-2170 MiB into a level load
whose depth and render target allocations then failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
with the heap at its reported budget where a run logged it.

The storage image budget is now what the reported budget leaves after the heap's use other
than the cached storage images, the unused part of the sampled textures' 2 GiB floor and an
eighth of the budget; the caps at a quarter of the budget and at TextureCacheBudget and the
512 MiB floor stay. The sampled budget still reserves TextureCacheBudget for the storage
cache, at least the storage cap, and the storage budget reserves the sampled textures alive,
so neither counts bytes the other may take; while the sampled textures alive stay within
their floor the sampled budget falls first, then the storage budget, and above it both fall
together. The budget line also prints when the storage image budget moves by more than a
tenth, with its previous value, and StorageTextureCacheBudget is exported for the execution
test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-17 12:33:05 +02:00
Yunus Shaikh 7b3826a42d Merge main into fix/recompiler-once-per-pixel-sample-inputs
main d7262bd6d6 adds the single-sample scan entry after the custom MSAA
sample locations entry in the AGC debt file. Keep it after this
branch's version of that entry.
2026-10-17 03:04:20 -07:00
Adrià d7262bd6d6 Merge pull request #5915 from SandstromPL/fix/agc-single-sample-scan-multisampled-depth
fix(agc): rasterize a single-sample scan into a multisampled depth target at the pixel center
2026-10-17 12:00:13 +02:00
AlxcBTW a58a709116 fix(agc): compare moved dispatch buffers at their build-time clamped size
A read-only V# the build clamps (size above the descriptor range limit cut to the
mapped end, stride overhang cut to the allocation end) was compared with the template
by its raw size, so an unchanged buffer counted as moved, was refused over the limit
and the dispatch rebuilt every time; a moved one with an overhang was snapshotted past
the allocation end. The build and the move proof now take the range from one function
(ShaderResources::guestBufferBytes), compare clamped with clamped and snapshot the
clamped range.

An overlay without a descriptor set is refused like one that could not be made, and
recording one throws instead of binding the template's set.
2026-10-17 11:23:47 +02:00
Dean 660cf7b215 Merge pull request #7001 from MarcZX100/codex/fix-viewbytes-range-6999
fix(agc): cover unaligned guest buffer views
2026-10-17 21:21:45 +13:00
Dean 7a2435edee Merge pull request #6814 from MarcZX100/codex/agc-library-prebuild-replacement-race
fix(agc): drain library prebuilds before device replacement
2026-10-17 20:52:21 +13:00
AlxcBTW 89d255c5f3 perf(agc): serve compute dispatches whose read-only buffers moved from the cached template
The content key of a compute stage leaves the base address and size of its
read-only guest buffers out, as a draw's key does. A template hit whose such
buffers moved is proved the way a draw's is (ShaderResources::MovedDispatchBuffers:
read-only, read in place when built, in reach, nothing pending over the new range)
and binds snapshots of the new ranges in a descriptor set of its own, kept with the
batch that records the dispatch. A refused proof builds the dispatch fresh, as
before. APS5_NO_DISPATCH_MOVE=1 turns the path off, APS5_DISPMOVE_MAX_KIB caps the
bytes snapshotted per dispatch.

A template whose storage image lies over memory that a depth surface covers is no
longer proved from stamps (fastRevalidate): cachedStorageTexture answers such a
binding with the plane's colour mirror, copied in from the depth image for every use,
and nothing stamps the appearance of a depth surface after the build. The full walk
decides, and a stale image can no longer be copied over the depth image.

Tests: Graphics.cpp (verdicts of the proof), execution DispatchMove (real device:
moved, exact, shortened, stored-over, own-output and written-range refusals) and
DispatchMoveDepth (a depth surface appearing over a template's plain storage image,
planes inside and outside the write watch, imports watched and unwatched).
2026-10-17 09:08:47 +02:00
MarcZX100 17973bc52d fix(agc): report sampler device limits 2026-10-17 03:59:59 +00:00
MarcZX100 45be3c0331 fix(agc): cover unaligned guest buffer views 2026-10-17 03:40:37 +00:00
MarcZX100 8359d82bb5 Merge remote-tracking branch 'upstream/pr-6695' into codex/fix-viewbytes-range-6999 2026-10-17 03:35:11 +00:00
SandstromPLandClaude Opus 5.5 e8614de271 fix(agc): rasterize a single-sample scan into a multisampled depth target at the pixel center
A draw with PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES 0 and MSAA_ENABLE clear
into a 4x depth target threw "the depth target's sample count differs
from the rasterizer's", which stops METAL GEAR SOLID: Peace Walker
(PPSA18216) at its first presentation. Such a draw now rasterizes the
depth target's sample count with every sample at the pixel center, as
a single-sample scan into a multisampled color target already does.
radeonsi programs this MSAA_ENABLE and PA_SC_AA_CONFIG with the depth
buffer's own sample count when GL multisampling is disabled, and GL
then gives full coverage with every depth and stencil sample set from
the pixel center.

Triangles and rectangles are accepted. Points, lines, alpha-to-coverage,
DB_EQAA Z interpolation or overrasterization, a pixel program reading
the sample index and a sample-mask export throw on this path, as does
a single-sample color target next to the multisampled depth target.
The primitive check is shared with the single-sample MSAA_ENABLE rule,
whose behaviour and messages are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:17:51 +02:00
Yunus Shaikh 3e802e45b8 fix(agc): draw sample-index and position inputs at sample 0's location
A one-sample target drawn by a multisampled rasterizer refused a pixel
shader that reads ANCILLARY with POS_X_FLOAT or POS_Y_FLOAT, because the
sample index made the host shade per sample and moved FragCoord from the
pixel centre. A shader the guest does not iterate now runs once per pixel
with sample number 0, and on this path the rasterizer keeps one sample, so
those draws are no longer refused. Resident Evil Village's (PPSA01556)
2x depth-only pass with SPI_PS_INPUT_ENA 0x2301 was one of them.
2026-10-16 12:43:16 -07:00
Yunus Shaikh bd09c49374 Merge main into fix/recompiler-once-per-pixel-sample-inputs
Main took request serialization versions 31 (output primitive size) and
32 (spanned waves), and #6683 uses 33, so the pixel iteration fields move
to version 34. A version 32 request keeps its spanned-waves flag and reads
no pixel iteration.
2026-10-16 12:41:06 -07:00
Romans Pokrovskis a0c51d5778 feat(agc): import uniform multisampled DCC fast clears 2026-10-16 21:13:39 +02:00
Adrià 24528f4e5a Merge pull request #5907 from simonbronk/feat/mixed-sample-truncate
feat(agc): rasterize a multisampled draw into one-sample targets at sample 0's locations
2026-10-16 21:05:45 +02:00
Adrià 6fd4de2666 Merge pull request #5937 from milescoviello/fix/db-render-control-copy-sample
fix(agc): accept a copy's sample selection on a draw that copies nothing
2026-10-16 21:05:36 +02:00
Adrià FranchandClaude 11f83f2d47 test(agc): keep the vertex BDA shader code static
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 18:33:34 +02:00
Adrià FranchandClaude a65d42755b test(agc): bound the cancelled journal replay from its own start
The cancelled replay's bound was taken from the totals before the torn-tail replay, which already
adds one present pipeline; when a worker reached the graphics recipe before the cancel, the test
failed (13 of 600 runs with 24 in parallel).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 18:13:46 +02:00
MarcZX100 81e3db853c fix(agc): drain library builds before device replacement 2026-10-16 13:02:11 +00:00
milescovielloandClaude Opus 5.5 2d5f761cb5 fix(agc): discard pipeline journals written before the mesh field
The layout guards only build on Linux with libstdc++, so a Windows or
macOS build of main after #5884 wrote journals whose mesh records lack
outputPrimitiveSize under the new shader-cache source version. The
journal format is now 3, so such a file is discarded instead of being
read with the new codec. MarcZX100 pointed this out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:45:11 +00:00
milescovielloandClaude Opus 5.5 b1e88d5995 fix(agc): journal the mesh output primitive size
#5884 added MeshConfiguration::outputPrimitiveSize, and #5875's pipeline
journal guards the layouts it encodes. The two merged separately, so on
Linux with libstdc++ PipelineJournal.cpp no longer compiles:
MeshConfiguration is 40 bytes, ShaderStages (which holds an optional
one) 112. The guards now name those sizes, and the recipe codec writes
and reads the new field, so a replayed line-strip geometry pipeline
keeps its two-vertex primitives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:36:25 +00:00
Adrià 65d56a297c Merge pull request #5804 from MarcZX100/codex/pixel-interlock-terminate-2009
fix(agc): stop pixel invocations on BDA faults when supported
2026-10-16 13:35:18 +02:00
Adrià 645644c488 Merge pull request #5884 from AnthonyClemens/fix/agc-geometry-line-strip-output
feat(agc): draw line-strip output of NGG geometry programs as mesh lines
2026-10-16 13:25:36 +02:00
Adrià Franch b85146dbf5 test(agc): keep the recompiled words alive in the terminate tests 2026-10-16 13:10:31 +02:00