Files
metal2vulkan/crates
Anees Iqbal 01a95a1932 Test that a rerouted draw draws through its own scissor rectangle
PR #13 (merged as cfe05d0655) made render/reroute.rs's Held keep the
encoder's scissor rectangles beside EncoderState, so a draw recorded again
into a new render pass instance draws through the rectangles it was drawn
through. Nothing tested it.

The device test (tests/rerouted_scissors.rs, under m2v_gpu / m2v_cpu_icd)
draws into a BGRA10_XR color the pass clears: a first draw writes white
through a small scissor rectangle, the rectangle is set to the render area,
and a second draw blends into the color with the blend color 0.5 as both
factors. That blend starts the color's half shadow, which records the first
draw again into an instance in the current one's place. The target must
hold 1.0 (code 894) inside the first rectangle and 0.5 (639) elsewhere; a
first draw recorded through the encoder's latest rectangle leaves 1.0
everywhere.

Evidence that the reroute ran: the blending pass leaves exactly one more
instance unrun than the same pass whose second draw writes
(WorkCounts::unrun_instances_ended), and no
extended-range-blends-stored-codes is announced. A device whose pass holds
no shadow, or that refuses the blending state as FramebufferFetch, prints
SKIPPED.

Verified: see the agent report (lavapipe and a Linux GPU, with the fix and
with reroute.rs's three lines reverted on a scratch commit).
2026-11-11 02:24:30 -08:00
..