Commit Graph
1823 Commits
Author SHA1 Message Date
Dean cc0078595d Merge pull request #8992 from SP4C3B4R-8/refactor/draw-prepare-record
refactor(agc): split Graphics::Draw into a prepare and a record step
2026-10-22 22:47:27 +13:00
SP4C3B4R-8 930b9640d7 refactor(agc): split Graphics::Draw into a prepare and a record step 2026-10-22 11:18:29 +02:00
Dean 7e2ba73e4c Merge pull request #7961 from milescoviello/fix/copied-region-transfer-src
fix(agc): give copied guest buffer regions transfer-source usage
2026-10-22 21:19:52 +13:00
Dean 865e06f1bc Merge pull request #7927 from whamre/feat/agc-depth-mips
feat(agc): render into depth mip levels
2026-10-22 19:09:06 +13:00
Werner 74f2fcb612 fix(agc): refuse a depth view mip on a surface without mips
AI-assisted: yes
2026-10-22 07:37:59 +02:00
Adrià 0c6a5bd593 Merge pull request #8519 from MarrasFederico/fix/agc-zero-stride-oob-select
fix(agc): follow RDNA 2's range checks for zero-stride vertex fetches
2026-10-21 21:54:30 +02:00
Dean 584c5a80fd Merge pull request #6718 from Zenodeon/stk-resource-performance-pr
perf(agc): avoid redundant texture-array CPU transfers
2026-10-22 08:30:01 +13:00
Adrià f0de89a506 Merge pull request #9026 from milescoviello/perf/depth-plane-unit-stores
perf(agc): store only the depth plane units a read overlaps
2026-10-21 21:29:26 +02:00
Federico Marras 58afce1ad1 fix(agc): follow RDNA 2's range checks for zero-stride vertex fetches 2026-10-21 20:16:30 +02:00
Adrià d27d05ec14 Merge pull request #7883 from thuanquang/fix/strip-last-provoking-gs
fix(agc): draw triangle strips through a geometry program with the last provoking vertex
2026-10-21 20:10:30 +02:00
Adrià eb6928696a Merge pull request #7984 from fisherjoey/fix/idle-publish-wait
fix(agc): wait for the idle flush's unit-shadow publish before returning
2026-10-21 20:10:04 +02:00
Adrià 3897c5c6bd Merge pull request #7849 from MarcZX10/codex/fix-host-import-partial-unmap-lifetime
fix(agc): retire host imports before range cuts
2026-10-21 20:09:59 +02:00
Adrià 9c437e8087 Merge pull request #7629 from EagleBearerYS/fix/agc-settle-alias-before-import-free
fix(agc): destroy settle aliases before their imports are freed
2026-10-21 19:57:39 +02:00
Dean 99844c7eef Merge pull request #8762 from JJenkx/fix/sparse-heap-existing-import
fix(agc): prefer imported prefixes before sparse heap mirrors
2026-10-22 06:22:49 +13:00
Dean 4ec064d29b Merge pull request #6887 from Amoenus/codex/test-msaa-reader-retile-main143
test(agc): connect MSAA sample readback to tiled layouts
2026-10-22 06:14:29 +13:00
MarcZX10 c566d31d1f test(agc): skip reimport bench below host budget 2026-10-21 16:53:05 +00:00
Dean d34da5d694 Merge pull request #7725 from milescoviello/fix/stencil-known-replace
fix(agc): draw a stencil replacement against a known stencil value as an inversion
2026-10-22 05:49:29 +13:00
MarcZX10 349a25f7ff fix(agc): remove stale trimmed-import call 2026-10-21 16:42:05 +00:00
MarcZX10 787a7bc39d fix(agc): retire imports after dropping cached address spaces 2026-10-21 16:42:05 +00:00
MarcZX10 a9b14023dd fix(agc): retire host imports before range cuts 2026-10-21 16:42:05 +00:00
thuanquangandClaude 0bd8f6188a fix(agc): draw triangle strips through a geometry program with the last provoking vertex
An RX 6700 XT hands a geometry shader odd strip triangle i as
(i+1, i, i+2) with the last provoking vertex, which is the order the
translator already uses, and since #7374 last mode takes the flat
outputs of the program's primitives from their last index. Keep the
last-mode refusal for fans only, which reach the program as
(i+1, i+2, 0) while the hardware gives (0, i+1, i+2). TEKKEN DARK
RESURRECTION (PPSA31371) stops on such a strip draw.

Co-Authored-By: Claude <[email protected]>
2026-10-21 21:41:01 +07:00
Dean 2c4b116da9 Merge pull request #7729 from milescoviello/fix/one-sample-depth-iter
fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample depth target
2026-10-22 03:14:54 +13:00
Romans Pokrovskis b4fbf24d1e feat(agc): upload individual multisample image samples 2026-10-21 16:06:59 +03:00
Romans Pokrovskis b8297adab9 feat(agc): add fragment-preserving R_X and Z_X layouts 2026-10-21 16:06:32 +03:00
Dean ce7d547175 Merge pull request #8856 from klosixgaming-arch/feat/agc-point-list-geometry-output
feat(agc): draw point-list output of NGG geometry programs as mesh points
2026-10-22 01:46:18 +13:00
Dean 0c83831421 Merge pull request #8975 from milescoviello/rebase/5499-db-depth-copy
feat(agc): run DB depth copies into a single-sample R32 float target
2026-10-22 01:20:22 +13:00
Adrià 98145b48d8 Merge pull request #7426 from DavidSamir/feat/shader-barycentric-tessellation-last-vertex
feat(agc): draw the last provoking vertex through the barycentric tessellation stages
2026-10-21 13:08:47 +02:00
Adrià 2cca5c0fd6 Merge pull request #7600 from milescoviello/feat/msaa-dcc-comp-to-single
feat(agc): take RADV's comp-to-single clear of a multisampled DCC target
2026-10-21 13:07:42 +02:00
Adrià 27fabb6b7d Merge pull request #7869 from savvaniss/feat/agc-polygon-mode
feat(agc): draw point and line polygon modes
2026-10-21 12:48:05 +02:00
Dean Galvin eb2aae7f8b fix(agc): refresh every layer a layered array color draw attaches
A slice of a 2D array color target was refreshed one layer wide while its attachment view spans color.layers, so a layered draw refreshed only its first slice. Pass the attached layer count.
2026-10-21 23:40:11 +13:00
Joey Fisher db3af40970 fix(agc): wait for the idle flush's unit-shadow publish before returning
The idle flush (VulkanDevice::StoreIdleResults) publishes the unit shadows over guest memory into
the host import and only submits the copies. publishUnits picks the units to store on the CPU,
and the slab -> import copy lands when the GPU runs it, so a guest store made between the two is
overwritten with the older shadow bytes. The memory-access hook waits through SyncThrough right
after its flush; the idle flush has no reader that waits.

FlushPending and PublishShadowsOnly now sync the recorder under the GPU mutex after an idle
publish that stored units. Other flush reasons are unchanged.

Test: agc_idle_publish_wait (a CPU store made after the idle flush returns survives; a label
flush's publish stays recorded).
2026-10-21 04:13:42 -06:00
milescovielloandClaude Opus 5.5 f57bbc936a perf(agc): store only the depth plane units a flush overlaps
A read of memory inside a stale D32 Z_X depth plane (FlushDepthPlanes) stored
the whole plane: a copy of the depth image into the mirror, MarkWholeWritten
and a write-back of every byte. In Super Meat Boy 3D (#8840) a read-only
buffer ending about 3 KiB inside a stale 3840x2160 plane makes
ShaderResources::Revalidate flush ~1000 times per 5 s, each one moving
31.9 MiB, bound by transfer bandwidth.

A depth surface now tracks its plane as 64 KiB units, each one 128x128 tile
of the mirror's block units: a stale bit and a write generation per unit
replace memoryStale and the plane-wide syncedGeneration.

- FlushDepthPlanes stores only the stale units the range overlaps: the depth
  to mirror copy takes one region per unit rectangle (UnitRects, from the
  mirror's slice windows), the mirror marks just those units written
  (MarkUnitsWritten) and the write-back covers their hull. The other units
  stay stale and the plane stays registered. Stale bits are cleared only
  after the copy was recorded, and the stored units' generations advance
  only when FlushPending stored them. A depth fast clear still pending at
  the store rewrites the whole image, so it makes every unit stale first.
- SyncFromMemory copies from the mirror only the units the guest wrote since
  their own generation (one ChangedBlocks scan; untracked memory counts as
  unwritten, as WrittenSince did), so a guest write into one unit no longer
  replaces GPU depth that is still unstored in the others.
- Flushes followed by a retire keep the whole-plane store: the color target
  flush in Draw and a written storage view (DepthPlaneScope::Whole). The
  retire of an overwritten surface in DepthSurfaceTexture first stores its
  remaining stale units the guest did not write.
- A mirror without block units (APS5_NO_BLOCK_TRACKING, unaligned base)
  falls back to the whole-plane copy, and APS5_DEPTH_PLANE_WHOLE_STORE=1
  tracks the plane as one unit, the previous behaviour.
- DepthPlaneStoreCounts reports stores, units and bytes stored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:03:00 +00:00
Dean aa37bc7aef Merge pull request #6683 from EagleBearerYS/fix/agc-sample-location-grid-exact
fix(agc): keep the guest's sample order where pixel (0,0)'s locations stand in for a 2x2 grid
2026-10-21 23:00:12 +13:00
milescovielloandClaude Opus 5.5 127aba3ed6 fix(agc): order and address DB depth copies like the surfaces they read
- Drain the draw pipeline before recording the copy, as the CB metadata
  pass does, so the copy follows the queued draws that render the plane.
- Address the plane as decodeDepth registers it: a multisampled plane's
  pipe-bank XOR bits are stripped and a DB_DEPTH_VIEW slice is added.
  Mipmapped or partially resident planes are refused.
- Refuse a color target with CMASK fast clears, as the CB resolve does.
- Find the source through the depth owner (planeSurface) and require a
  32-bit float surface with the decoded sample count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 08:54:50 +00:00
Dean 27c88a8d75 Merge pull request #8224 from savvaniss/fix/agc-strided-overhang-render-target
fix(agc): bind a strided buffer's last record only up to the render target it runs into
2026-10-21 21:32:49 +13:00
milescovielloandClaude Opus 5.5 120900a342 fix(agc): read one-sample DB depth copies through sampler2D
A one-sample depth surface was bound to the copy shader's sampler2DMS,
which Vulkan only allows for a multisampled view. The shader is now
built in a single-sample and a multisample variant, and the copy picks
one by the surface's sample count. The copy also no longer requires the
guest-memory import state of native multisample depth sampling: it reads
the host image the draws rendered into. Its barriers name the host stage
their host access bits need, as the CMASK clear's do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 08:03:33 +00:00
codingreapermapsandClaude Opus 5.5 191c8a8d2b feat(agc): run DB depth copies into a single-sample R32 float target
A draw with DB_RENDER_CONTROL.DEPTH_COPY copies one sample of the
Z_32_FLOAT depth surface into color target 0. It now runs as a compute
pass that fetches that sample and stores it into the R32 float target,
when the draw covers the whole surface without depth or stencil tests.
With COPY_CENTROID the sample is the first one the draw covers, which is
sample 0 under the full sample mask the driver requires, as radeonsi
programs its per-sample DB to CB copies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 08:03:33 +00:00
Savvanis SpyrosandClaude Opus 5.5 863167d33d fix(agc): advance the pipeline journal format past main's
main's journal format is already 5, so this branch's bump to 5 no
longer marks the journals written before its polygon-mode field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:13:32 +03:00
Savvanis SpyrosandClaude Opus 5.5 e61d31d287 feat(agc): draw point and line polygon modes
PA_SU_SC_MODE_CNTL with POLY_MODE set to a point or line type was refused,
and every triangle was drawn filled. The state decode now takes the polygon
type of the faces that are not culled into State::polygonMode, ignores the
types when POLY_MODE is clear or the primitives are points or lines, and
keeps refusing front and back types that differ while both faces are drawn.

Points are drawn one pixel wide (PA_SU_POINT_SIZE 0x00080008 inside
PA_SU_POINT_MINMAX), the size VK_KHR_maintenance5 gives a point whose
shader does not write PointSize, and lines one pixel wide (PA_SU_LINE_CNTL).
The device enables fillModeNonSolid and maintenance5 when they are
available. The polygon mode joins the pipeline, library and draw keys and
the pipeline journal (format 5).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:13:32 +03:00
Savvanis SpyrosandClaude Opus 5.5 1c0e23afc5 fix(agc): trim a strided overhang at the render target only for read-only buffers
A store to the trimmed tail of a written buffer would be dropped instead
of failing as an alias of the render target, so only read-only buffers,
such as per-attribute vertex fetches, are trimmed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:09:17 +03:00
Yunus Shaikh 8c9c8eb5b5 Merge main into fix/agc-sample-location-grid-exact
main 7ce3b1df3e took disk-cache format 43 (#8295) for its own layout, so this
branch's format moves to 44. The request serializer stays at 42: main
still writes 41.
2026-10-20 23:48:14 -07:00
Yunus Shaikh 6d09797d6b Merge main into fix/agc-sample-location-grid-exact 2026-10-21 05:39:42 +00:00
Dean GalvinandZenodeon 5f7fa7abcc Merge origin/main into PR 6718
Co-authored-by: Zenodeon <[email protected]>
2026-10-21 18:10:12 +13:00
Dean GalvinandRajkamalcode da0ae843ac Merge origin/main into PR 7912
Co-authored-by: Rajkamalcode <[email protected]>
2026-10-21 18:05:58 +13:00
Dean 042504ea28 Merge pull request #8554 from aarushkha/fix/pipeline-cache-header-long-path
fix(agc): read the pipeline cache header through the long-path form on Windows
2026-10-21 17:20:34 +13:00
Dean 56e088c1ad Merge pull request #8802 from JJenkx/fix/agc-retain-map-import-failures
fix(agc): retain map import failures across unrelated mappings
2026-10-21 16:35:29 +13:00
klosixgaming-arch ee81c5112d feat(agc): draw point-list output of NGG geometry programs as mesh points
A geometry program with VGT_GS_OUT_PRIM_TYPE 0 (point list) was refused
as an unsupported output assembly, halting Cocoon (PPSA08766) on boot
with "VGT_GS_OUT_PRIM_TYPE other than a triangle strip, or a line strip
from a geometry program, is unsupported".

Each primitive export of an NGG point-list geometry program outputs one
point whose vertex index is stored directly in PrimitivePointIndicesEXT,
so the mesh module now declares OutputPoints with PrimitivePointIndicesEXT
for it when outputPrimitiveSize is 1. The point primitive export extracts
the 9-bit vertex index from the packed primitive export word and stores
it to the output array. A subgroup gets up to maxVertices points, with
provoking vertex 0 and point raster primitive topology.

Tested with Cocoon (PPSA08766) which now progresses past pipeline
creation and initial frame draws into gameplay.

AI-assisted: yes. Written with AI assistance and reviewed by me.
2026-10-20 22:26:30 -05:00
Dean 51a30d567a Merge pull request #8297 from thuanquang/docs/trunc-coord-debt
docs(agc): record that the host sampler replaces TRUNC_COORD's rounding
2026-10-21 16:09:49 +13:00
Dean 394170059f Merge pull request #8069 from thuanquang/fix/force-degamma-unchanged-formats
fix(agc): sample formats that FORCE_DEGAMMA leaves unchanged without it
2026-10-21 15:44:22 +13:00
Dean b13183e59e Merge pull request #7473 from Dripl1x/codex/skip-clean-resident-write-watch
perf(libc): skip write-watch queries for proven clean resident ranges
2026-10-21 14:55:09 +13:00