Commit Graph
583 Commits
Author SHA1 Message Date
Adrià c82ffb0f20 Merge pull request #6647 from binarycleric/fix/agc-table-update-after-bind
fix(agc): bind image and sampler tables through update-after-bind limits
2026-10-19 12:20:50 +02:00
Dean 7f37d45ed3 Merge pull request #6451 from EagleBearerYS/fix/agc-sample-location-grid-fallback
fix(agc): fall back to pixel (0,0)'s sample locations where the device has no 2x2 grid
2026-10-19 22:22:04 +13:00
Adrià 5de7c09c37 Merge pull request #6669 from milescoviello/fix/msaa-cmask-codes
fix(agc): read a multisampled target's CMASK by its MSAA codes
2026-10-19 10:44:42 +02:00
Adrià f161098d3b Merge pull request #6563 from notaxeltv/feat/agc-msaa-enable-rect-list
fix(agc): allow MSAA_ENABLE single-sample rect lists
2026-10-19 10:44:32 +02:00
Adrià b715404323 Merge pull request #6646 from EagleBearerYS/fix/agc-heap-mirror-replan-unwatched
fix(agc): plan a heap again when its mirror's range has left the write watch
2026-10-19 10:15:31 +02:00
Jon Daniel 070a3f12c6 fix(agc): bind image and sampler tables through update-after-bind limits
Image and sampler table capacity came only from the regular descriptor
limits. MoltenVK reports Metal's argument table limits there (256 sampled
images and 16 samplers per stage), below the typed heaps the tables are
reserved on top of, so both capacities were 0 and every table draw or
dispatch was refused as if the device lacked descriptor indexing. Its
update-after-bind limits are 1000000 sampled images and 500000 samplers.

- descriptorBindingSampledImageUpdateAfterBind is queried and enabled, and
  the update-after-bind limits are read when either it or the storage
  buffer feature is present.
- A table whose regular capacity is 0 takes its capacity from the
  update-after-bind limits. Its binding is update-after-bind and its set
  layout and pool are update-after-bind ones, in ShaderResources and in
  DescribeSetLayouts alike. A table that fits the regular limits is
  unchanged.
- An update-after-bind set layout and its allocation are checked against
  the update-after-bind sampled image and sampler limits when the device
  has descriptorBindingSampledImageUpdateAfterBind. Vulkan counts the
  descriptors of such sets against those limits in place of the regular
  ones, and requires them to be at least the regular ones only when the
  feature is supported, so without it, and for storage images, the
  regular limits are kept as before. Storage buffers keep their own
  update-after-bind flag.
- Compute pipeline capture and replay accept update-after-bind sampled
  image and sampler bindings.
2026-10-19 09:34:13 +02:00
notaxeltvandCursor 92f11a93ed fix(agc): allow MSAA_ENABLE single-sample rect lists
Filled rectangles (VGT_PRIMITIVE_TYPE 7 and 17) use the same single-sample MSAA_ENABLE path as triangles; PPSA03541 stops on a rect-list draw otherwise.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 09:23:53 +02:00
Dean Galvin 23fc286e4c Merge main into pr-6451
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-19 20:08:05 +13:00
gguerra26 538b63ef4c fix(agc): normalize unused viewport depth ranges
Use representable viewport endpoints only when the draw has no depth attachment and its pixel shader does not read PositionZ. Preserve XY coverage, clip-space mode, depth clamping, and validation of non-finite inputs.

Balatro (PPSA21402) reaches rendering on Apple M1 with MoltenVK after this change instead of stopping at VK_EXT_depth_range_unrestricted. Depth-dependent draws retain their original behavior.
2026-10-19 09:02:24 +02:00
Adrià 72aba1dff5 Merge pull request #6571 from klosixgaming-arch/fix/agc-cb-resolve-msaa-disabled
fix(agc): compare a CB resolve's sample count with the rasterizer onl…
2026-10-19 08:58:54 +02:00
Adrià fdf64dba83 Merge pull request #6567 from SleglJan/pr/rewritten-set-variable-count
fix(agc): reuse a recycled descriptor set only for a table of its own size
2026-10-19 08:52:26 +02:00
al3w0f205 55d4a9fa1d feat(libSceAgcDriver): support quad-list primitive type
Primitive type 19 (DI_PT_QUADLIST, 0x13) is used by Unity and other engines for UI quads, sprites and font glyphs. Because Vulkan lacks native quad-list primitive topology, quad draws are expanded on the CPU into indexed triangle lists with 6 indices per 4-vertex quad, respecting the first/last provoking vertex configuration and discarding incomplete trailing vertices. Adds unit tests and documents the functional debt.
2026-10-19 07:39:59 +02:00
Dean 4ffb0cd12b Merge pull request #7377 from EagleBearerYS/fix/shader-pixel-bda-single-exit
fix(shader): end a pixel shader's failed BDA reads through one exit
2026-10-19 18:22:07 +13:00
Adrià ceab3dd674 Merge pull request #6523 from billythemenace2/fix/agc-mesh-support-before-validation
fix(agc): refuse mesh-path draws on a device without mesh shaders before validating them
2026-10-19 06:08:33 +02:00
Adrià e0b8be9dc5 Merge pull request #6530 from milescoviello/feat/smoothing-mixed-samples
feat(agc): draw radeonsi line and polygon smoothing (SAMPLE_COVERAGE, merged mixed samples)
2026-10-19 06:06:26 +02:00
Dean 3ddbc4accc Merge pull request #4650 from Mouad-Scriptz-0/feat/agc-depth-range-remap
feat(agc): remap a viewport depth range the device cannot express into the vertex shader
2026-10-19 16:52:31 +13:00
Dean 3fda339541 Merge pull request #7169 from Ondra97/codex/fix-command-batch-fence-failure
fix(agc): ignore failed fence creation outputs
2026-10-19 16:52:12 +13:00
billythemenace2andClaude Opus 5.5 60a2aa47d6 fix(agc): refuse mesh-path draws on a device without mesh shaders before validating them
A draw on the mesh path was validated before its pipeline checked for
mesh shader support, so on a device without VK_EXT_mesh_shader (an RDNA1
RX 5700 XT) Sackboy: A Big Adventure (PPSA01289) stopped on "subgroup
capability 61 is unsupported for shader stage 128" instead of the actual
cause. ValidateShaders now takes the device's mesh shader support and
refuses such a draw first with "device does not support mesh shaders".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 05:19:01 +02:00
klosixgaming-arch 0d4cbd538b fix(agc): compare a CB resolve's sample count with the rasterizer only under MSAA_ENABLE
PPSA08270 (Eternights) stopped after its story intro with "AGC graphics:
CB resolve from a target whose sample count differs from the
rasterizer's". It resolves a 4x 512x512 target into a single-sample one
with PA_SC_MODE_CNTL_0.MSAA_ENABLE off while PA_SC_AA_CONFIG still holds
2x from earlier draws. Without MSAA_ENABLE the scan converter does not
use PA_SC_AA_CONFIG's sample count, so the resolve takes its sample
count from CB0 as it already does when PA_SC_AA_CONFIG is single-sample.
2026-10-19 03:06:07 +00:00
Dean fa0ac6d5ce Merge pull request #5926 from xXPBSXx/fix/agc-vertex-fetch-overhang
fix(libSceAgcDriver): zero the overhanging record of a vertex fetch
2026-10-19 15:56:44 +13:00
Yunus Shaikh e19cf1ac21 Merge main into fix/agc-heap-mirror-replan-unwatched
The host-import debt entry takes main's budget sentence and keeps this branch's heap-mirror sentence.
2026-10-18 19:55:25 -07:00
Jan ŠléglandClaude Opus 5.5 04aef899a6 fix(agc): reuse a recycled descriptor set only for a table of its own size
DescriptorCache::AllocateRewritten handed out any recycled set of the requested layout. The
variable descriptor count of an image-table binding is fixed when its set is allocated, and
PrepareDrawBindings writes the table's present elements, up to its current element count, into
the set it gets. A draw whose table had more elements than the table the recycled set was
allocated for could write descriptors past the set's allocation
(VUID-VkWriteDescriptorSet-dstArrayElement-00321).

A set from a chain pool now records the variable count it was allocated with, as a dedicated-pool
set already does, and recycled sets are kept per layout and variable count, so a rewritten draw
reuses a set only for a table of the same size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 04:40:35 +02:00
Dean Galvin 41764f27ac Merge main into pr-4650
# Conflicts:
#	core/shader/recompiler/ShaderDiskCache.cpp
2026-10-19 15:36:07 +13:00
AhirandClaude Opus 5.5 f970620d95 fix(agc): keep half the host heap out of the host import budget
Imports, type-3 mirrors and the buffers and textures placed in host memory share the driver's system memory heap. On Windows that heap is half the physical memory, so on a 16 GiB machine the old budget (the heap less 2 GiB) let imports hold about 6 of its 8 GiB, and host buffer allocations then overflowed into the 256 MiB device-local host-visible heap and failed. The budget now reserves the larger of 2 GiB and half the largest host heap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 04:11:15 +02:00
xXPBSXxandClaude Sonnet 5.5 d01548e81b fix(libSceAgcDriver): zero the overhanging record of a vertex fetch
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 03:47:33 +02:00
Adrià 23629c2847 Merge pull request #6454 from EagleBearerYS/perf/shader-image-table-reuse-v3-pr
perf(agc): share one image table per heap and write epoch through capture, compare, resolution and descriptors
2026-10-19 03:39:03 +02:00
Adrià 72b0ab3e8e Merge pull request #6312 from meh7an/perf/agc-cut-draw-allocations
perf(agc): cut per-draw heap allocations
2026-10-19 03:38:58 +02:00
Dean Galvin 4d4ae6e5eb Merge main into pr-4650
# Conflicts:
#	core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
#	core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
#	core/shader/recompiler/tests/RequestSerializerTests.cpp
2026-10-19 14:32:36 +13:00
milescovielloandClaude Opus 5.5 f0b208a073 test(agc): expect one-sample rasterization of a smoothing draw without MSAA_ENABLE
Since #6196, a one-sample target under a multisampled rasterizer with
MSAA_ENABLE clear is drawn as one sample instead of refused, so the
overrasterized draw with MSAA_ENABLE clear now decodes as one sample without
merged coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:25:34 +00:00
milescovielloandClaude Opus 5.5 51ac7d36e2 fix(agc): journal merged coverage with the pipeline state
Pipeline creation and the pipeline store key read State::mergedCoverage,
but the journal's state codec and CanonicalPipelineState dropped it, so a
journalled merged-coverage pipeline replayed as a plain multisampled one
and the draw built its pipeline again. The codec and the canonical state
now carry it and the journal format becomes 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:25:33 +00:00
milescovielloandClaude Opus 5.5 7f59934b7d feat(agc): draw radeonsi line and polygon smoothing through merged mixed samples
A radeonsi-style GL driver smooths lines and polygons by rasterizing four
samples into a one-sample color target: PA_SC_AA_CONFIG has 4 samples,
DB_EQAA.OVERRASTERIZATION_AMOUNT is log2(4), and the pixel shader reads
SAMPLE_COVERAGE to scale alpha by the covered samples. The pixel is written when
any of the four samples is covered. DecodeState refused the one-sample target as
a sample-count mismatch.

Such a draw (MSAA_ENABLE set, no depth target, no per-sample shading, every
color target one-sample, OVERRASTERIZATION_AMOUNT matching the raster samples)
now decodes with mergedCoverage. Its pipeline keeps the raster sample count,
gives the color attachments one sample (VkAttachmentSampleCountInfoNV or the
render pass) and merges coverage (VK_COVERAGE_REDUCTION_MODE_MERGE_NV). The
device enables VK_NV_framebuffer_mixed_samples and VK_NV_coverage_reduction_mode
when it reports that combination; elsewhere the pipeline throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:25:33 +00:00
Yunus Shaikh b6489b863a Merge main into fix/agc-sample-location-grid-fallback
The custom MSAA sample-location debt entry keeps this branch's grid stand-in text and takes main's sentence on ANCILLARY and the position inputs of a once-per-pixel shader.
2026-10-18 18:25:31 -07:00
milescovielloandClaude Opus 5.5 03b0db0520 feat(shader): load the SAMPLE_COVERAGE pixel input from gl_SampleMaskIn
SPI_PS_INPUT_ENA/ADDR bit 14 (SAMPLE_COVERAGE_ENA) gives the pixel shader one
VGPR, after ANCILLARY, holding the samples the primitive covers. The decoder
refused it and the recompiler never loaded the VGPR. It is now loaded from
gl_SampleMaskIn[0] (sharing the input the partial quad sample mask already
declares). On a multisampled draw the hardware word is the whole pixel's
coverage while gl_SampleMaskIn holds only the invocation's samples when the
pixel shader runs per sample, so that case, and sample-rate or ancillary inputs
beside it, are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 01:25:21 +00:00
Adrià 00666eeb36 Merge pull request #6470 from EagleBearerYS/fix/recompiler-once-per-pixel-sample-inputs
fix(recompiler): run a pixel shader the guest does not iterate once per pixel
2026-10-19 03:21:34 +02:00
Adrià 12c1d1875f Merge pull request #6464 from AymanFE/claude/project-thread-d8qx30
fix(agc): overestimate single-sample draws with centroid inputs
2026-10-19 03:02:01 +02:00
Mehran 9d6279ccfa perf(agc): cut per-draw heap allocations 2026-10-19 02:39:16 +02:00
Yunus Shaikh 106b79e007 Merge main into perf/shader-image-table-reuse-v3-pr
The data-hit verification keeps this branch's pending-span query on its ShaderMemory and takes #5958's CaptureInvocation, which retries a capture with converted samples.
2026-10-18 17:04:23 -07:00
Yunus Shaikh 10b798fb99 Merge main into perf/shader-image-table-reuse-v3-pr
Keeps this branch's tagVariantRuns declaration next to main's dumpRequest suffix parameter in Driver.hpp, and reads #6232's pointer-chain test words from its table's snapshot, where this branch keeps them.
2026-10-18 17:03:39 -07:00
Adrià a6dd29b3da Merge pull request #6215 from Ondra97/codex/fix-msaa-retired-target-lifetime
fix(agc): reclaim retired multisample color targets
2026-10-19 01:37:13 +02:00
Adrià 58242e7bcb Merge pull request #6320 from fdfawef324/codex/copy-transfer-budget-current-1015
fix(agc): count transient copy buffers toward the recorder budget
2026-10-19 01:24:48 +02:00
Ondra97andRomans Pokrovskis 785f8f7bcf fix(agc): reclaim retired multisample color targets
Co-authored-by: Romans Pokrovskis <motivated.it@gmail.com>
2026-10-19 01:08:37 +02:00
fdfawef324andCodex ea02128b5b fix(agc): count transient copy buffers toward the recorder budget
Charge read-only GPU-copy input snapshots and depth-copy linear scratch for their requested bytes while the batch retains them. Exercise both production paths with CPU Vulkan mocks, including the budget boundary and fence-governed resource retention.

Co-Authored-By: Codex <noreply@openai.com>
2026-10-18 18:21:23 -04:00
Dean Galvin cf4d1f4a97 Merge main into pr-4650
# Conflicts:
#	core/shader/recompiler/ShaderDiskCache.cpp
2026-10-19 11:15:57 +13:00
Yunus Shaikh d13a90d015 Merge main into fix/recompiler-once-per-pixel-sample-inputs
Resolves the shader debt file bullet by bullet: main's EmitSetAttribute entry, and this branch's PERSP_SAMPLE/LINEAR_SAMPLE and pixel-position entries.
2026-10-18 15:14:25 -07:00
Adrià 3f16b82132 Merge pull request #6297 from Gashrod1/fix/agc-undrawn-msaa-z-footprint
fix(agc): sample undrawn multisampled Z and D 64 KiB swizzle textures, and Z ones whose HTILE is cleared
2026-10-18 23:55:01 +02:00
Adrià 946e9d936b Merge pull request #6212 from milescoviello/fix/agc-inverted-scissor
fix(agc): treat an inverted scissor rectangle as empty
2026-10-18 23:26:54 +02:00
m.peau 69afb0569f fix(agc): sample undrawn multisampled Z and D 64 KiB swizzle textures, and Z ones whose HTILE is cleared 2026-10-18 22:44:13 +02:00
Adrià 8a7f434f19 Merge pull request #6196 from SandstromPL/fix/agc-msaa-enable-clear-one-sample-target
fix(agc): rasterize into one-sample targets as one sample when MSAA_ENABLE is clear
2026-10-18 20:49:55 +02:00
Yunus Shaikh d0325058f7 Merge main into perf/shader-image-table-reuse-v3-pr
#7527's selected-record limit test reads a record's descriptor words through the
table snapshot's shared words list; this branch keeps a snapshot's words per column,
so the test reads them from its column instead.
2026-10-18 11:33:00 -07:00
Yunus Shaikh dc47a81b02 Merge main into fix/recompiler-once-per-pixel-sample-inputs 2026-10-18 11:30:31 -07:00