d3d12: RSSetScissorRects with more than 16 rectangles keeps the first 16; d3d12_close_parity passes again (D3D-SCISSOR-COUNT-PARITY) #1286

Merged
aslan2142 merged 1 commit from upstream-pr/1286 into main 2026-11-24 21:25:12 +00:00
aslan2142 commented 2026-11-24 21:16:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T21:16:42Z.


Claimed in the coordination issue as: D3D-SCISSOR-COUNT-PARITY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144591297)

What and why

d3d12_close_parity has failed on main since #510 was merged (found by QemmHD in https://github.com/ubiquitarianism/leonida/pull/510#issuecomment-7143969965):

FAIL RSSetScissorRects(17): layer Close 0x80070057, WARP succeeds
  • #510 made RSSetScissorRects with more than 16 rectangles an error (check(false)), so the list's Close returns E_INVALIDARG.
  • WARP closes such a list, and the parity row at runtime/test/d3d12_close_parity_test.cpp:362 expects the layer to match it.
  • This change keeps the call valid: the rectangles past the 16 a pipeline can have are dropped, with a one-time stub notice. Counts from 1 to 16 behave as before.
  • RSSetViewports(17) is unchanged; the parity test already lists it as a known stricter case.

I merged #510, so this is my regression to fix. One file: runtime/shims/d3d12_com.cpp.

Tested

The Windows runtime was cross-built on Linux with clang-cl / lld-link 23.1.5 and the xwin MSVC CRT and Windows SDK 10.0.26100, and the full ctest suite was run under Wine 11.22, headless, on two devices. No game files.

Test main this PR, llvmpipe this PR, RDNA2 iGPU
d3d12_close_parity 1 failure, RSSetScissorRects(17) passes passes
d3d12_multi_viewport (from #510) passes passes passes
  • Against the full-suite results of main under the same setup, no test changes from pass to fail on either device.
  • This is clang-cl under Wine, not MSVC on Windows, and under Wine the parity test compares against its recorded WARP column. A run on real Windows would be welcome.

GPUs tested: Mesa llvmpipe (LLVM 23.1.5) and AMD Ryzen 9 7950X3D integrated graphics (RDNA2, RADV, Mesa 26.3.1), Linux, through Wine 11.22

AI-assisted: yes (Claude Code, Claude Fable 5.2)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480478697 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1286). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T21:16:42Z. --- Claimed in the coordination issue as: D3D-SCISSOR-COUNT-PARITY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144591297) ### What and why `d3d12_close_parity` has failed on `main` since #510 was merged (found by QemmHD in https://github.com/ubiquitarianism/leonida/pull/510#issuecomment-7143969965): ``` FAIL RSSetScissorRects(17): layer Close 0x80070057, WARP succeeds ``` - #510 made `RSSetScissorRects` with more than 16 rectangles an error (`check(false)`), so the list's `Close` returns `E_INVALIDARG`. - WARP closes such a list, and the parity row at `runtime/test/d3d12_close_parity_test.cpp:362` expects the layer to match it. - This change keeps the call valid: the rectangles past the 16 a pipeline can have are dropped, with a one-time `stub` notice. Counts from 1 to 16 behave as before. - `RSSetViewports(17)` is unchanged; the parity test already lists it as a known stricter case. I merged #510, so this is my regression to fix. One file: `runtime/shims/d3d12_com.cpp`. ### Tested The Windows runtime was cross-built on Linux with clang-cl / lld-link 23.1.5 and the xwin MSVC CRT and Windows SDK 10.0.26100, and the full `ctest` suite was run under Wine 11.22, headless, on two devices. No game files. | Test | `main` | this PR, llvmpipe | this PR, RDNA2 iGPU | |---|---|---|---| | `d3d12_close_parity` | 1 failure, `RSSetScissorRects(17)` | passes | passes | | `d3d12_multi_viewport` (from #510) | passes | passes | passes | - Against the full-suite results of `main` under the same setup, no test changes from pass to fail on either device. - This is clang-cl under Wine, not MSVC on Windows, and under Wine the parity test compares against its recorded WARP column. A run on real Windows would be welcome. GPUs tested: Mesa llvmpipe (LLVM 23.1.5) and AMD Ryzen 9 7950X3D integrated graphics (RDNA2, RADV, Mesa 26.3.1), Linux, through Wine 11.22 AI-assisted: yes (Claude Code, Claude Fable 5.2) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator rule.)
quartz-heron-58 commented 2026-11-24 21:23:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-24T21:23:49Z.


Independent Windows run of 4ff9a77f: Windows 11 build 26300, NVIDIA GeForce RTX 4080 (621.24), MSVC 14.44 RelWithDebInfo, built with scripts\build_runtime.ps1.

  • d3d12_close_parity: passes. 113 cases, 82 match WARP, 16 known layer-stricter, 15 known layer-looser, 0 failures. The RSSetScissorRects(17) row reads 0x00000000 | 0x00000000 | match, and the layer prints the one-time note that the first 16 are used.
  • On main 6261ca91 (measured in another tree, merged into the #1028 branch) the same test fails with RSSetScissorRects(17): layer Close 0x80070057, WARP succeeds, 81 matching.
  • d3d12_multi_viewport: all 4 cases, 64/64 pixels exact against host D3D12.
  • ctest -j 6, whole suite: 314 of 314 pass.

One run of each. No game files. Not run: other GPUs, validation layers.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144874519 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1286#issuecomment-7144874519). Originally posted by [quartz-heron-58](https://github.com/quartz-heron-58) on 2026-11-24T21:23:49Z. --- Independent Windows run of 4ff9a77f: Windows 11 build 26300, NVIDIA GeForce RTX 4080 (621.24), MSVC 14.44 RelWithDebInfo, built with `scripts\build_runtime.ps1`. - `d3d12_close_parity`: passes. 113 cases, 82 match WARP, 16 known layer-stricter, 15 known layer-looser, 0 failures. The `RSSetScissorRects(17)` row reads `0x00000000 | 0x00000000 | match`, and the layer prints the one-time note that the first 16 are used. - On main 6261ca91 (measured in another tree, merged into the #1028 branch) the same test fails with `RSSetScissorRects(17): layer Close 0x80070057, WARP succeeds`, 81 matching. - `d3d12_multi_viewport`: all 4 cases, 64/64 pixels exact against host D3D12. - `ctest -j 6`, whole suite: 314 of 314 pass. One run of each. No game files. Not run: other GPUs, validation layers. AI-assisted: yes (Claude Code)
QemmHD commented 2026-11-24 21:31:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T21:31:44Z.


Confirmed after the merge on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24, VS 2022, Ninja, RelWithDebInfo), with a fresh build of main 51757ec55. The results are identical plain and with LEONIDA_VK_VALIDATION=1, with 0 VUIDs:

  • d3d12_close_parity passes: 113 cases, 0 failures. RSSetScissorRects(17) now returns 0x00000000, matching WARP.
  • d3d12_multi_viewport passes all 4 cases, an exact match against host D3D12.
  • d3d12_draw passes.

Thanks for the quick fix.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7145049170 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1286#issuecomment-7145049170). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T21:31:44Z. --- Confirmed after the merge on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24, VS 2022, Ninja, RelWithDebInfo), with a fresh build of main 51757ec55. The results are identical plain and with `LEONIDA_VK_VALIDATION=1`, with 0 VUIDs: - `d3d12_close_parity` passes: 113 cases, 0 failures. `RSSetScissorRects(17)` now returns `0x00000000`, matching WARP. - `d3d12_multi_viewport` passes all 4 cases, an exact match against host D3D12. - `d3d12_draw` passes. Thanks for the quick fix. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1286
No description provided.