From 4ff9a77f1f88aca66255233fd338298d8b7047f7 Mon Sep 17 00:00:00 2001 From: Jan Trencansky Date: Tue, 24 Nov 2026 16:10:54 -0500 Subject: [PATCH] d3d12: RSSetScissorRects with more than 16 rectangles keeps the first 16 (D3D-SCISSOR-COUNT-PARITY) The multi-viewport change made a call with more than 16 rectangles an error, so the list's Close returned E_INVALIDARG. WARP closes such a list, and d3d12_close_parity has that row ("RSSetScissorRects(17)", match), so the test has failed on main since that merge. The call is no longer an error: the rectangles past the 16 a pipeline can have are dropped, with a one-time notice. Co-Authored-By: Claude Fable 5.2 --- runtime/shims/d3d12_com.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index 42c8e5cea7..cb2b06270d 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp @@ -439,7 +439,12 @@ class GraphicsCommandList final return; } if (!rects) return; - if (count > D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) return check(false); + // WARP still closes a list after RSSetScissorRects(17) (d3d12_close_parity), so the call is not an error: + // the rectangles past the 16 a pipeline can have are dropped. + if (count > D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) { + stub("ID3D12GraphicsCommandList::RSSetScissorRects(more than 16 rectangles; the first 16 are used)"); + count = D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; + } scissors_.fill({}); for (UINT i = 0; i < count; ++i) { scissors_[i] = {rects[i].left, rects[i].top, rects[i].right, rects[i].bottom};