Commit Graph
548 Commits
Author SHA1 Message Date
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 <[email protected]>
2026-10-17 12:33:05 +02:00
Yunus Shaikh 3d42f60978 Merge branch 'fix/agc-sample-location-grid-fallback' into fix/agc-sample-location-grid-exact
The fallback branch's merge of main brings 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:05:00 -07: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
Yunus Shaikh cebbd414eb Merge main into fix/agc-sample-location-grid-fallback
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:15 -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
Yunus Shaikh 7539ba6116 Merge branch 'perf/agc-host-import-aligned-blocks' into perf/agc-remember-evicting-refusals 2026-10-17 01:01:31 -07:00
Yunus Shaikh e60ca87228 Merge branch 'perf/agc-host-import-aligned-blocks' into perf/agc-host-import-blocks 2026-10-17 01:01:30 -07:00
Yunus Shaikh f03efaeb48 Merge main into perf/agc-host-import-aligned-blocks
main 52798f71d5 declares ExistingHostImportFor next to HostImportFor
(#6892). Keep it beside this branch's HostImportFor, which takes a
requester.
2026-10-17 01:01:03 -07:00
Alex ColliniandClaude Opus 5.5 b7e21ca031 fix(agc): tell a set without a storage table from a stored element past its capacity
Both cases printed that the image storage table exceeds its capacity. They need different fixes, so each now has its own message with the set, the element's index in the set and the capacity. The debt entry now says that the index counts every table element before it in the set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 08:45:46 +02:00
Alex ColliniandClaude Opus 5.5 35a12f5c5c fix(agc): size the pool for the storage table and check table store elements like direct ones
The non-split descriptor set's pool now counts the storage table binding's
descriptors, as the split path already did. A table storage element whose
minimum LOD clamps above the level it addresses is rejected per element, as
the direct path refuses it, and the element is looked up as written so a depth
surface under it is retired. The registration test checks again that
image_store_mip, image_store_pck and image_atomic_add through a table stay
unsupported operations that fault on use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 08:45:46 +02:00
Romans Pokrovskis 15eb12009c fix(agc): refuse native MSAA vertex buffer reads 2026-10-17 08:09:24 +03:00
Romans Pokrovskis 1ec58a5cd4 Merge commit '1271998d444c9f05a3330c96fc08d81c7e148bd4' into codex/validate-native-index-6590-main16 2026-10-17 07:40:59 +03:00
Dean ec6d3989f3 Merge pull request #6675 from xXPBSXx/docs/debt-agc-registered-shader-type-8
docs(debt): list the unprepared AGC shader types
2026-10-17 16:45:04 +13:00
SandstromPLandClaude Opus 5.5 237fe9c269 docs(agc): cite the GL rule the multisampled depth scan follows
The debt entry cited ARB_multisample's centermost-sample shortcut as
what a single-sample scan into a multisampled depth target draws. The
draw tests each depth and stencil sample with the depth at the pixel
center, which is the rule above that shortcut (L185-L190 and
L422-L425); the shortcut is now named as an unmeasured alternative.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 00:17:51 +02: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 <[email protected]>
2026-10-17 00:17:51 +02:00
Romans Pokrovskis 3a9240a50d docs(debt): avoid adjacent MSAA contribution insertions 2026-10-16 23:44:50 +03:00
Romans Pokrovskis b4e66bfde8 fix(agc): complete sampled MSAA geometry after fragment sizing 2026-10-16 23:33:49 +03:00
Yunus Shaikh f7e1f5d2e8 Merge branch 'fix/agc-sample-location-grid-fallback' into fix/agc-sample-location-grid-exact
Takes #6451's merge of main. Main's spanned-waves flag took request
serialization version 32, so the sample order moves to version 33; a
version 32 request keeps its spanned-waves flag and reads no sample order.
Multisampled color targets now gain storage usage on their first storage
binding; a target whose samples may be reordered still gets it at creation,
and the recorder's storage-usage checks expect that.
2026-10-16 12:46:37 -07:00
Yunus Shaikh d06d3eea86 Merge main into fix/agc-sample-location-grid-fallback
Main's one-sample target test expected a pattern varying between pixels
to be refused on a device without a one-sample 2x2 grid; with the grid
fallback it takes pixel (0,0)'s locations instead, so the test now
expects it to be accepted.
2026-10-16 12:45:44 -07: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
Yunus Shaikh c7e07cae44 Merge main into perf/agc-async-settle
Main's #5905 settles Linux dma-buf imports with settleImport, which is
now built on both platforms. The batched settle of Windows imports under
1 MiB, its counters and adoptSettleDevice's batch reset stay Windows-only,
and ClearHostImports drains the batches only there.
2026-10-16 12:37:41 -07:00
SandstromPLandClaude Opus 5.5 bb877791ac fix(agc): rasterize into one-sample targets as one sample when MSAA_ENABLE is clear
On top of #5882, a draw with PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES 2 (4x),
MSAA_ENABLE clear, a one-sample color target and no depth target threw
"a color target's sample count differs from the rasterizer's", which
stops METAL GEAR SOLID: Peace Walker (PPSA18216) at its first
presentation (draw C on #5268). Without MSAA_ENABLE every sample is at
the pixel center, and a one-sample target keeps the coverage of sample
0, so the draw is now drawn as a one-sample draw.

PS_ITER_SAMPLE, ANCILLARY or SAMPLE_COVERAGE pixel inputs and a
sample-mask export throw on this path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 00:48:30 +05:30
Romans Pokrovskis a0c51d5778 feat(agc): import uniform multisampled DCC fast clears 2026-10-16 21:13:39 +02:00
Yunus Shaikh efdba5df45 Merge branch 'perf/agc-host-import-aligned-blocks' into perf/agc-remember-evicting-refusals 2026-10-16 12:12:13 -07:00
Yunus Shaikh 18ef6b27b4 Merge branch 'perf/agc-host-import-aligned-blocks' into perf/agc-host-import-blocks 2026-10-16 12:11:57 -07:00
Yunus Shaikh 4cceec19e2 Merge main into perf/agc-host-import-aligned-blocks 2026-10-16 12:11:02 -07: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à daf8913128 Merge pull request #5905 from hugodearaujo/fix/agc-prewarm-mapped-dma-buf
fix(agc): settle dma-buf imports on Linux on the settle queue
2026-10-16 21:05:30 +02:00
Yunus Shaikh 583cca0993 fix(agc): keep the stand-in for every pass on a device without multisampled storage images
On such a device a pass with a multisampled color target is refused, because the color samples have no storage view to be reordered through, while a depth-only pass was still reordered. A depth target drawn by both then held its samples in the guest's order after the depth-only pass and was tested in the stand-in's order by the color pass, so on odd rows each sample met the depth of the other half-pixel's position. With #6451 alone both passes kept the stand-in's order. Such a device now refuses the exact order for every pass, so each of its depth targets keeps one order. On a device with multisampled storage images, a color format without a storage view at its sample count still refuses only its own passes, which the debt entry now says.
2026-10-16 11:22:54 -07:00
Yunus Shaikh 418d5abb88 Merge main into fix/agc-sample-location-grid-exact
Brings #5884's request field (output primitive size, read from serialization version 31). This branch's sample order stays at version 32, read after it, so a version-31 request reads as before.
2026-10-16 06:37:54 -07:00
hugodearaujo 9bd554a64e fix(agc): note where a map-time settle blocks, and expect settles only for dma-buf imports
An import made at map time settles inside the guest's map call, so the mapping thread waits while the kernel maps the pages. A device that imports shared memory through host pointers settles nothing, so the test expects a settle only for a dma-buf import.
2026-10-16 08:28:23 -03: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à FranchandClaude Fable 5.1 4aafda8e3b perf(agc): journal the pipelines of a run and build them ahead on the next one
A graphics pipeline the store builds or a compute pipeline a dispatch builds is
appended to pipelines.journal next to the shader cache entries, as the
materialized result of each stage (the specialized SPIR-V, bindings and push
constants) plus the recipe the pipeline was built from: the stages'
identities, vertex input layout, descriptor set layout keys and the state
fields the Pipeline constructor reads. When a VulkanDevice is created with a
window (a headless device waits for its first draw or dispatch, since the
window's device usually replaces it first) the journal is loaded and its
pipelines are built on a pool of threads while the title loads, so the first
draw or dispatch of a configuration seen on an earlier run finds its pipeline
resident instead of compiling it on the queue worker.

The pipeline stores key on RecompileResult::Identity, a hash of the module
words, specialization constants, subgroup width and bindings that is the same
on every run (SharedSpirv::ContentHash, computed once per shared module),
rather than on the process-lifetime variant ids; a generated stage is keyed
like any other. CachedPipeline builds outside the store's mutex and the
library parts and link are built outside the library store's mutex, so replay
threads and queue workers build in parallel; a concurrent build of the same
key keeps the first inserted. A replayed pipeline enters the store at its
least recently used end and a full store takes none, and its optimized relink
waits for the first draw that binds it, so the title's own pipelines come
first in both. The compute pipeline creation moves into
VulkanDevice::createComputePipeline, shared by dispatches and the replay. The
store key also covers the color component mapping, the depth target's sample
count and a depth bias clamp, which the constructor reads.

The file names the device it was written for (the properties the driver's
pipeline cache file is named by) and starts over for another; a torn tail is
cut at a record boundary; two runs sharing the directory take turns on a lock
file and keep each other's records; a read failure never starts the file
over. A device cancels its replay before it is replaced or destroyed, and a
replaced device destroys its pipelines then rather than at the driver's stop.

APS5_NO_PIPELINE_JOURNAL=1 disables it; APS5_PIPELINE_JOURNAL_THREADS,
APS5_PIPELINE_JOURNAL_ENTRIES (the first recorded), APS5_PIPELINE_STORE_ENTRIES
and APS5_PIPELINE_JOURNAL_MAX_MIB bound it; APS5_PROFILE_DRAW prints a
[pipeline-journal] summary. APS5_VERIFY_SET_LAYOUTS=1 now also checks a
dispatch's set layout against the one described from its shader. The lavapipe
test suite, which shares one cache directory, runs with the journal off except
for the journal's own tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6hw3kRAuQdfcU9YCZgaoK
2026-10-16 12:52:28 +02:00
Adrià 51acb79ac4 Merge pull request #5828 from billythemenace2/fix/agc-non-image-tsharp-as-null
fix(agc): treat a TYPE 1 T# in a read-only static image slot as null
2026-10-16 12:34:28 +02:00
Ondra97 5356078ec1 fix(shader): flush f64 min and max inputs by float mode 2026-10-16 11:55:11 +02:00
fdfawef324andClaude Opus 5.5 13b171cab5 feat(agc): keep the last submissions per queue and dump them on a stall or crash
A GPU hang or a crash in a title leaves no record of what the queues
were last given: APS5_TRACE_GPU prints every submission (too much to
leave on), and the WAIT_REG_MEM timeout message shows only the packet
before the wait on the waiting queue.

Each queue now keeps a ring of its last 16 submissions
(APS5_PM4_RING=<n>, 0 to 4096, 0 disables): the TraceMs time in tenths
of a millisecond, serial, size, guest address and a copy of the first
512 dwords after indirect buffers are inlined, recorded under the
driver lock next to the serial, REWIND tails included. The ring of a
queue and the failure report registration are set up at the top of
Submit, before any output is reserved, so recording under the lock
does not allocate. Disabled, Submit only tests a static flag; enabled,
it costs one bounded copy per submission.

DumpSubmissionRings decodes the kept dwords with Pm4::PacketWords and
the new Pm4::KnownName, which returns the decoder's names as views of
static strings (empty for an unknown opcode, printed as UNKNOWN_0x%02x);
Pm4::Name now builds its std::string from it. Every line is formatted
with integer and string conversions only into a 512-byte stack buffer
and written with one WriteFile / write(2) on the stderr handle, so the
dump does not allocate from the C runtime heap, lines from other
threads do not interleave and the CRT stream lock is not taken (the
rule of #3871). The header gives the number of queues and the ring
size, and each queue line the submissions recorded and kept.

libc gets a small registry of failure reports
(LibcRegisterFailureReport_nid_no_patch, Unregister, Run); Run runs
the registered reports the first time it is called and returns at once
after that. The Windows crash report runs it after the thread dump of
an unhandled exception, after SIGABRT (which also covers the
APS5_HANG_DUMP_SECS timed dump, since it aborts) and after an invalid
CRT parameter, so an abort after a reported exception does not print
the rings twice. The driver registers its dump at the first submission
and unregisters at static destruction; the dump there waits a bounded
time for each ring lock. What the crash-path dump cannot do (a ring
held by the crashed thread, rings corrupted by the crash, Linux) is
recorded in technical debt.

APS5_STALL_WATCHDOG_SECS=<n> (0 to 86400, 0 disables) makes a waiter
that has not progressed for n seconds dump the rings once per wait: a
WAIT_REG_MEM (progress as for APS5_GPU_WAIT_TIMEOUT_MS: another packet
runs or completes), a REWIND waiting for the title, and a compute
submission held behind queue 0. The last one prints under the driver
lock, so submissions and the other queues wait for it (USAGE.md says
so). Both variables are read at the top of Submit, so an invalid value
of either throws at the first submission and never later inside a GPU
worker. The order wait behind queue 0 releases its order hold on scope
exit, so a throwing dump cannot leave it counted.

No packet semantics change; packet sizes and names are those of the
existing decoder (PM4 type-3 header layout as in Mesa
src/amd/common/sid.h). The queue bound of Submit and of the rings is
one constant, SubmissionQueueEnd.

Tests: agc_driver_pm4_tests gets ten modes, each its own ctest:
agc_driver_pm4_ring (APS5_PM4_RING=4, six submissions on queue 0 and
two on 0x20: the dump holds #3..#6 and #1..#2 in order, nothing
older), agc_driver_pm4_ring_empty (one line), _ring_disabled (one
line), _ring_invalid and agc_driver_pm4_stall_watchdog_invalid
(APS5_STALL_WATCHDOG_SECS=1x: the submission throws and is not
executed), _ring_report (LibcRunFailureReports_nid_no_patch dumps the
rings), _ring_report_heap (Windows: with ucrtbase.dll's HeapAlloc and
HeapReAlloc imports counting calls from the reporting thread, the
failure report of a submission holding INDEX_BUFFER_SIZE names it and
allocates nothing, while Pm4::Name of the same header is seen
allocating), and with APS5_STALL_WATCHDOG_SECS=1 a WAIT_REG_MEM
(agc_driver_pm4_stall_watchdog), a REWIND (_stall_watchdog_rewind) and
a compute submission held behind a queue 0 rendering wait
(_stall_watchdog_order), each held for about 2.5 s, dump once and
complete when released. The PM4 catalog test checks KnownName against
every opcode and custom name. windows_backtrace_failure_report checks
that abort() runs the registered reports once and not an unregistered
one; windows_backtrace_failure_report_once that abort() does not run
them again after an earlier run. With the dump decoding through
Pm4::Name, agc_driver_pm4_ring_report_heap fails with "the failure
report allocated from the C runtime heap"; with Run resetting its
flag, windows_backtrace_failure_report_once prints the report twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:18:26 +02:00
Yunus Shaikh a48aa76934 perf(agc): step a remembered evicting refusal down without a new scan
An evicting request whose block is refused but leaves room for its own
range steps down to a smaller block, and only the last block it tried
was remembered. Once an address-based build had stepped down inside a
block, every later evicting request for the rest of that block scanned
every import at the block's level before it reached the memory below.

A refusal is now remembered before the request steps down, with the
room it left. A remembered refusal answers with the same decision the
scan would make: while the memory is current only a lower budget can
change that room, so the request steps down to the same smaller block
when its range fits in the room, and is refused otherwise.
2026-10-16 08:34:53 +00:00
Yunus Shaikh cceba477f6 perf(agc): remember an evicting join's budget refusal
A join's budget refusal was never remembered, so a buffer bound across
ranges that the budget could not take tried the join, with a scan of
every import, at each upload's pre-pass. A join now remembers its final
refusal like any other evicting request, under the same conditions. The
memory keeps whether it was a join and answers only the same kind of
request, since a join skips the held-import check and never steps down.
2026-10-16 08:18:34 +00:00
Yunus Shaikh cc42ab0198 perf(agc): answer any range of a refused block from its evicting refusal
An evicting refusal was remembered for the range holding the requested
address and dropped by a request for another range of the same run, so
requests landing in different ranges of one refused block, as uploads
and accesses across a block of adjacent ranges do, scanned the imports
every time. The memory now keeps the room the refusal left and answers
any range of the run that is larger than it: such a range cannot step
down to a block of its own either. A smaller range still recomputes,
and a run that cannot step down at all is answered for every range.
2026-10-16 08:17:09 +00:00
Yunus Shaikh a3fefab585 Merge main into perf/agc-remember-evicting-refusals 2026-10-16 00:56:15 -07:00
Yunus Shaikh 219da69c32 perf(agc): keep an evicting refusal remembered while the budget shrinks
The remembered refusal of a request that may evict expired on any budget
change. A smaller budget can only keep the request refused, and #6479
moves the budget in 64 MiB steps once a second, so the memory now ends
only when the budget grows, as #6479's stillRefused does.
2026-10-16 07:18:33 +00:00
Tripchipp bd9d0c3d7d fix(tools): keep debt entries without a core link in the index 2026-10-16 09:09:21 +02:00
simonbronkandClaude Opus 5.5 b766ce4fb5 feat(agc): keep sample, sample-index and per-sample shading on the sample-zero path
A multisampled rasterizer drawing into one-sample targets keeps
PERSP_SAMPLE, LINEAR_SAMPLE and ANCILLARY inputs, and with PS_ITER_SAMPLE
also centroid inputs, since only sample 0's coverage reaches the targets.
Coverage inputs, and the sample index with POS_X_FLOAT or POS_Y_FLOAT,
still throw. The input rule for the non-iterated case follows
fdfawef324's proposal on #5907 (PPSA07411).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 08:58:33 +02:00
simonbronkandClaude Opus 5.5 9bf98992ff feat(agc): rasterize a multisampled draw into one-sample targets at sample 0's locations
A draw whose rasterizer has more samples than its color or depth targets
threw "a color target's sample count differs from the rasterizer's" or
"the depth target's sample count differs from the rasterizer's". When
every target has one sample, MSAA_ENABLE is set, and there is no
alpha-to-coverage, no PS_ITER_SAMPLE and no sample-dependent pixel input,
only sample 0's coverage reaches the targets, so draw it with one sample
at sample 0's location in each pixel of the grid. One-sample depth images
are created sample-location compatible when the device allows it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 08:58:33 +02:00
Yunus Shaikh 4ee79e522e perf(agc): remember an evicting import request's budget refusal
At a full host import budget with nothing evictable, a request that may
evict tried again on every use, and each try walked every live import to
add up what could be evicted. In a title's first scene at its 6400 MiB
budget that was 37,627 refusals per present, each one a walk over about
4,400 imports, while the address-based builds kept every import held.

Such a request now remembers its final refusal, the one with no smaller
block left to try. Later requests for the same run, from the same range,
are answered from that memory, still counted as refused and remembered,
until an import is made or retired, the budget or the import window
changes, the run's ranges change, or an import could have become
evictable. An import becomes evictable only once the use count passes
its last use by the 256-use protection, and a held one also needs a
higher build floor, so the walk records the first such use among the
imports it could not evict, held ones apart: the memory survives a new
build while no held import can age out yet. Requests that may not evict
keep their behaviour.
2026-10-16 06:45:27 +00:00
Yunus Shaikh 815b8add6f test(agc): check that a settle read ends the driver's marking of an import
A Windows import under 1 MiB returns to the write watch once its settle
read has completed, though main-queue work submitted before the read may
have used the import first, and an earlier import of the same pages may
not have run its first use yet. On the NVIDIA driver (617.42) neither
marks the pages once the read has completed, so the rewatch needs no wait
for the main queue. The docs said the marking lasts until the import's
first GPU use completes; they now say that a completed GPU use ends it,
the settle read included.

agc_import_settle_first_use submits 4096 copies of a 64 KiB import on
the main queue before its settle read is queued. The import must return
to the write watch while the copies still run, and the driver must mark
none of its pages afterwards.

agc_import_settle_earlier_import records 4096 copies of a 64 KiB window
import, replaces it with the import of its whole 128 KiB range, and
submits the copies only once the range is back in the write watch. The
driver must mark none of the range's pages while they run. A driver that
keeps marking fails either test.
2026-10-15 23:43:07 -07:00
Yunus Shaikh ee406d6179 docs(agc): give the 3070's per-count sample location grids and say why a moved sample mask throws
The device setup logs each sample count's largest grid. On the RTX 3070
Laptop GPU (617.42) it is 2x4 at 2 samples, 2x2 at 4 and 1x2 at 8,
while maxSampleLocationGridSize is 1x1 for every count; the AMD Radeon
iGPU reports 2x2 both ways. So the 3070's 2x patterns take the native
grid, and the stand-in plus the exact path serve its 8-sample patterns
and devices without a grid.

The throw for a uniform partial sample mask that the order moves stays.
The order is fixed at decode, before compilation shows whether the pixel
program writes memory, and falling back would lose exactness on draws
the exact path gets right. The entry now says when the draw throws, what
#6451's stand-in did with it, and what a fix would take.
2026-10-16 06:23:50 +00:00
Yunus Shaikh c3f947ef47 docs(agc): say the 3070 draws 2x patterns on its grid and name the depth transitions and the sample mask throw
The debt entry said the RTX 3070 Laptop GPU reports a 1x1 grid for
every count. That is VkPhysicalDeviceSampleLocationsPropertiesEXT; the
device setup reads each count's VkMultisamplePropertiesEXT, which gives
an even grid at 2 samples, so the 3070 draws 2x patterns on its grid.

The entry also gains the transition that ends a pass drawing depth at
custom sample locations, and the throw for a draw with early depth or
stencil tests whose pixel program writes memory when the order moves a
partial sample mask into the pixel shader.
2026-10-16 06:16:00 +00:00