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]>
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.
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).
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]>
- 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]>
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]>
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]>
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]>
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]>
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]>
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.
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.