The translator writes guest SampleMask from the register after the declared color outputs, preserving that value when the same program is translated again. A depth result uses its separate output register. The mask is not replaced by an input-coverage value or by a cached register number. The fixed pipeline mask also applies to bit 0 of a single-sample target; a zero mask preserves its color and depth.
With dithering disabled, alpha-to-coverage supports 1, 2, 4, 8 and 16 samples through a shader prefix mask:
(1 << floor(clamp(alpha, 0, 1) * samples)) - 1. NaN selects no samples. The result intersects the guest output mask;
the fixed pipeline sample mask still applies. With dithering enabled, an ordered 4x4 threshold refines the covered
sample count, and a pixel-dependent rotation distributes the selected sample indices. Endpoints still select no
samples for alpha zero and all samples for alpha one. This is a deterministic implementation of the API's spatial
dither contract, not a claim to reproduce an undocumented native pattern.
Coverage and alpha tests use the original alpha. Independently of coverage enable, software alpha-to-one replaces
every floating-point color alpha with one and disables native
alpha-to-one; integer color outputs retain their bits. An integer primary output skips these alpha operations.
This software path needs no host alphaToOne feature. The ordering follows
Vulkan multisample coverage.
The current pipeline uses ordinary rasterization. A future smooth-line mode would need a separate ordering gate
because its native line-coverage alpha factor occurs after fragment shading.
Coverage-to-color accepts the supported signed or unsigned single-component R8/R16/R32 integer target. The ordered capture path currently requires target 0 alone, no logic operation and the same direct-list restrictions as source capture above. It reads all validity samples before writing the union mask to each surviving sample, so host sample shading cannot narrow the mask when the fragment shader runs in separate invocations. A direct post-depth fragment mask alone cannot establish that union when host invocations split. If every attachment and rasterization use one sample, a post-depth fragment mask is the whole pixel mask. This shader path also supports DrawTexture, MRT and indirect draws. It requires post-depth coverage, no alpha-to-coverage or shader depth/sample-mask output, and either explicit early tests or no discard, alpha test or shader storage writes. DrawTexture always uses the latter gate. Native coverage output remains available under its own capability checks. The guarded single-sample D32F/S8 shadow path also supports late-test coverage-to-color without forcing early tests or splitting a whole draw. It preserves the original guest side effects, applies fixed/guest sample bit 0, and discards native integer color output after the interlock when the late tests fail. Its depth and draw-state restrictions are the same as the late-shadow subset above.
Color and depth/stencil targets retain independent sample layouts. Native coverage modulation supports a depth sample count equal to the raster count, including a larger count than color. Equal raster/color counts use a fragment multiplier for active custom coefficients and retain the original sample shading. The multiplier requires signed-zero/infinity/NaN preservation, uses the original alpha for tests, and applies alpha-to-one before modulation. Both software dither modes retain that ordering with alpha modulation. A disabled mode or a unity coefficient does not create an otherwise redundant pipeline. Masked clears separate unlike attachments so their pipelines retain legal sample counts; color-only clears preserve depth/stencil.
The portable mixed-coverage path captures each primitive into separate source attachments and one shared validity attachment at the raster sample count. It supports one through seven contiguous single-sample color targets, subject to the host attachment limit, reserving a separate output for validity. Each target retains its own native blend equation, logic operation, component mask and format conversion. Resolve resources for every target are prepared before changing any destination. A fragment pass counts surviving samples, discards empty pixels, applies the selected coefficient, and uses native color state once per target and primitive. Depth/stencil runs against the original raster-sample attachment during capture. This retains overlapping primitive order and the distinction between zero coverage and a covered zero-valued source. Coefficients use push constants so table changes reuse shaders and pipelines. Immutable source/valid descriptors are reused only within their frame and image lifetimes. Guest output-register order and types remain separate from the extra validity output.
The reduction reads ordinary sampled images, so it does not need multisample storage images or formatless storage reads/writes. Its validity image uses R8 when the device supports that format at the required extent and sample count, with RGBA8 as fallback. This reduces the logical validity payload from four bytes to one byte per raster sample without reducing source precision. Physical allocation and compression remain implementation dependent. The advanced-blend compute path retains its separate storage-image requirements.
This fallback requires noninteger targets starting at slot 0 with equal extents, one layer, distinct native images and nonaliasing guest backing. The initial MRT path also requires contiguous mapped backing for each target. Absent fragment outputs preserve their bound targets, and zero component masks skip their final resolves. Partial output declarations with effective component writes remain excluded until all blending inputs are proven. Filled triangle lists, the vertex splitting proof and a translator proof of sample-invariant fragment sources are required. Fragment inputs, textures, constant-buffer interfaces, other guest memory, sample-dependent instructions, active advanced blending and dual-source blending do not qualify. Optional depth/stencil must have the raster sample count. A final resolve of an arbitrary whole draw would not preserve these semantics.
Color and depth/stencil discard hints retain their command order and replay against immutable target snapshots. The renderer receives a whole-surface hint only for a proven unpadded, single-layer view covered by every scissor, with no active conditional predicate. Partial views, volumes, other layers and padding keep their contents. A discard may legally preserve contents; this hint can avoid a future attachment load but does not remove stores that were already recorded.
vk_descriptors_mode=0 selects sets, 1 selects descriptor buffers, and 2 prefers VK_EXT_descriptor_heap. The
default 3, Automatic, is 2 on a GPU that shares the system's memory and 0 on one with memory of its own; 2
selects heaps, buffers, then sets according to device support. Existing shader set/binding decorations map to
separate resource and sampler index runs; heap pipelines use their own push-data state. Auxiliary compute pipelines
keep legacy descriptor pools. Legacy binds invalidate heap state, and the descriptor-set bind generation forces
descriptor buffers to be rebound after an auxiliary pass. Pipeline, complete-set and binding caches retain the
selected backend in their state.
Heap capacity includes the implementation's reserved ranges. Resource and sampler frame partitions are clamped independently to the queried limits, with exact descriptor sizes and alignments. Sampler encodings are interned by their opaque bytes; all comparisons use CPU shadows. Live heap bytes, index tables and buffer descriptors remain immutable until the frame fence and command-pool reset permit reuse. A failed heap write does not submit midway through draw setup: the complete draw retries through buffers or sets. Buffer arenas are allocated lazily when used.
Heap resource-cache entries use 32 bytes with an exact 28-byte key; sampler entries use 16 bytes and verify hash matches against every opaque encoding byte in the CPU shadow. The 4,096 resource and 2,048 sampler entry capacities are unchanged. This saves 49,152 bytes of CPU metadata without reducing the descriptor heap or its cache capacity. Consecutive identical indexed image descriptors reuse their first resolved index. Unformatted buffer misses can encode up to eight descriptors per native call, with distinct scratch destinations and publication only after a successful call. Logical descriptor counts and actual native call counts remain separate benchmark fields.
Only active indexed map rows are staged, and unchanged words retain their staging address within the frame. Indexed image bindings still contain complete 256-element arrays, including null entries. Changes to another descriptor can therefore require another full index table even when its image encodings are reused. Compact heaps can retire more often for that workload. The separate descriptor measurements report copied bytes, physical allocation, cache storage, encoding calls/hits and retirement counts for each backend and workload. They include retirement waits and recording completion in CPU submission timing. Binary content checks surround every gate and measurement, and measured device names must match the renderer gate.
The latest upstream GPU ownership changes remain in place. Eligible graphics storage-image ranges stay GPU-owned until the CPU touches them; a retained owner supplies the original bytes if a CPU merge later becomes necessary. All five graphics stages transfer or release their retained references on commit or retry. Pending buffer lookup uses covered pages, pitch-linear texture updates copy changed rows, and DMA copies only affected owned ranges and tiles. These mechanisms preserve the write-tracking and ownership fallbacks for ranges that cannot stay on the GPU.
Made from docs/history/gpu-rendering-audit.md at 69237645142c. GPL-3.0-or-later.