One record, DrawFast, holds the last full draw's kept outputs and its key. A draw takes it when the key holds, and
then runs only the EACH steps.
The key:
gmem_read and compared, because the constant buffer changes with the draw;DsDynamic, DsViewports and DrawCall that the kept part reads: the viewport transform and
swizzle, the viewport 0 depth, cull and bias, alpha test, window and sprite origin, clip height, the fixed-function
fields (raster samples, coverage, multisample flags, sample locations, subpixel bias, advanced blend, state flags,
shading rate), the topology, mesh and indirect, and whether the vertex buffers are empty;gpu_mem_generation(), a range check, not a stamp. The record keeps the generation gw0 and a list of ranges:
each slot's texture and sampler headers, each non-target texture's memory, the memory of a texture kept over a
target, and the targets. On a draw where the generation moved, each range is tested with
gpu_mem_dirty_since(gw0, address, size). Where all are clean, the record takes the new generation.What a hit copies: the shaders and last, edges and points, the targets (rt, zt, n, bound), the blend and
coverage choices, fs, fk and the per-slot TexRes and TexOver, tf, the coverage and sample location keys,
fs_spec, the pipeline key and pl, ke and the pipeline.
What a hit does again:
vk_rt_note_read of the kept part (the targets, a target sampled whole, the source of a copy of a target). A
note can reload a target and move the surface table's epoch, so the notes come before the stamp checks, and a moved
epoch ends the hit;shadows=0 test (S15) and the asynchronous pipeline test (S17);ke->used, g_draw.last, g_draw.fs) and the statistics.Never kept:
predraw_slots, a predraw probe), capture draws, texture draws and the predraw
phases;draw_state_check=1. There each draw runs in full, and a draw the fast path would have taken is
compared with it;goto retry drops the record), or a draw after predraw_run or
draw_forget.Made from docs/dev/draw-fast-path.md at 69237645142c. GPL-3.0-or-later.