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