Files
metal2vulkan/docs
Anees Iqbal 9f2ca244ff rt: attachment reads through a copy into a shadow, on a device without the feedback loop
A device whose descriptor limits hold set 1's second elements but that does not report
attachmentFeedbackLoopLayout and attachmentFeedbackLoopDynamicState (the UHD 630 on Windows, driver
101.2145) refused every draw that reads an attachment of its own pass through a texture. It now
reads through a copy: the one form left on that device, recorded as a known gap.

The query: floor::Capabilities::attachment_reads is the descriptor room alone, and the new
feedback_loop is the room plus both extensions and features; device creation enables the
extensions, features and dynamic-state loader only where feedback_loop holds, so the extension
device test's expected list (core().feedback) follows the query unchanged.

The form (crate::shadow): an image a draw may read so gets one shadow, same format, extent, levels
and layers, made at its first reading draw, homed by the next submission's upload, freed with the
image (Free::Shadow) and counted in Gauges::shadows and shadow_bytes. A texture reaching the
rendered level and layer reads its own view of the shadow at its second element (index + 65,536),
written under the owner rule (Arrays::place_shadow); one reaching neither reads the image at home.
The points are the feedback form's: the pass's first reading draw, and a reading draw after a
memory barrier after draws (which leaves every shadow holding nothing). At any reading draw the
planner copies what the shadow does not hold, as one area per read where what is new is one, with
no look-ahead: an own-pixel slot reads the scissor a pixel wider each way, clamped; any other every
level and layer its texture reaches. The copy ends the rendering, records one barrier (a global
memory barrier, the image's copied ranges to transfer source from the attachment layout or home,
the shadow's to transfer destination), the copies and one barrier back, and begins again. Each
copy counts in Metrics::attachment_read_copies and attachment_read_copy_bytes, and in
bytes_copied.

Docs: the rt README (set 1's second elements, the render encoder's copy form, the floor's
attachment reads and extension table, the chosen-by-a-query note, and the known gap with the UHD
cost: 39.0 to 53.5 us a MiB plus 3 to 8 us a copy, about 12 to 16.5 ms a frame for r3 and 4 to 5.5
ms for b3, from the census's 298.0 and 93.4 MiB a frame), DrawKind::AttachmentRead, REFUSALS.md
regenerated and the public signatures blessed.

Tests: host unit tests of the planning (tests::shadow) and of the floor's two answers; the device
test of attachment reads now runs the copy form where the device has it, asserting its barriers
(7), copies (2) and bytes, the live shadow, and the texels, and printing the counters; the level
test runs it too, one copy a level. Checks are run on the potluck legs after this commit.
2026-11-18 08:57:13 -08:00
..