[PR #722] [MERGED] d3d12: expand IA-selected rectangles on triangle-family PSOs (RT-IA-RECTANGLE-VARIANT) #762

Closed
opened 2026-11-26 20:18:58 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/722
Author: @Rain156
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: fix/ia-rectangle-triangle-pso-20261124


📝 Commits (2)

  • b10e0e9 runtime: reuse the Xbox rectangle geometry generator from #682
  • c55ecc9 d3d12: expand rectangle draws through triangle-family pipelines

📊 Changes

5 files changed (+374 additions, -2 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+4 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+67 -0)
➕ runtime/src/rect_list_geometry.h (+268 -0)
📝 runtime/src/vulkan_replay.h (+6 -1)
📝 runtime/test/d3d12_translated_draw_test.cpp (+29 -1)

📄 Description

Claimed in the coordination issue as: RT-IA-RECTANGLE-VARIANT (claim).

Depends on: #682

What and why

The first-run UI compositor binds a triangle-family graphics pipeline, then selects Xbox rectangle-list topology (17) on the input assembler. The three submitted corners drew one triangle. In a 3840 × 2160 pass, this left half the output untouched.

Replay now selects a pipeline variant with a generated geometry stage for that draw. The variant cache distinguishes rectangle expansion and the unbound attachment mask. Triangle draws on the same PSO keep their original pipeline. PSOs with the same linked vertex program share the snapshot used to build the geometry stage on first use.

The first commit carries only tedin7’s geometry generator from #207 / #682, byte-for-byte, so this can build against current main. The second commit contains the draw-time selection and its regression. The explicit type-19 PSO and quad-list implementation are tracked in #682.

Tested

  • Clean main 51f316092 with the new synthetic GPU test fails at pixel (0, 32) on the first rectangle draw. On this branch, the same PSO alternates rectangle and triangle draws twice. All 4,096 target pixels match on each frame. The regression also passes with the Khronos validation layer and synchronization validation enabled. Run ctest --test-dir <build> -C RelWithDebInfo -R ^d3d12_translated_draw$ --output-on-failure on a Vulkan-enabled Windows runtime build.
  • In separate offline runs of a local integration build, selecting the variant raised the two fullscreen passes from 4,147,200 to 8,294,400 fragment invocations each. Swapchain readback went from 926,903 to 1,855,276 non-black pixels out of 1,858,304. A Windows compositor capture independently showed the diagonal cutoff gone and the full row of first-run controller prompts visible. A second launch with the exact generator shipped here produced pixel-identical RGB at the swapchain and, independently, in the Windows window capture. The screen has a plain background. These runs exercise an integration that also includes the constant-buffer row addressing tracked in #513. Gameplay and the 3D world have not been verified.
  • Full Windows runtime build and all 305 registered CTests. Across the standard run and two validation-enabled reruns, 293 passed and 11 skipped. The remaining d3d12_vulkan_device failure reproduced on clean main on this adapter, with identical HRESULT differences for committed-resource flags 0x200 and 0x400.
  • The translator suite ran 465 files containing 6,108 tests. The one module that failed to launch llvm-mc with a backslash-delimited Windows path passed all nine tests when rerun with a forward-slash LLVM_MC path. Viewer streaming passed 57/57 and documentation links passed 16/16.
  • Repository game-data scan and git diff --check pass. Local merge checks against current main and #682 are clean.

GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 x64 build 26200 (MSVC RelWithDebInfo).

AI-assisted: Yes (Codex).

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • Repository game-data scan passed for all tracked files.
  • Shader translator rules are unchanged.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/722 **Author:** [@Rain156](https://github.com/Rain156) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `fix/ia-rectangle-triangle-pso-20261124` --- ### 📝 Commits (2) - [`b10e0e9`](https://github.com/ubiquitarianism/leonida/commit/b10e0e9d5a24c90bfc1a6d2370fcfcf641f3fbc7) runtime: reuse the Xbox rectangle geometry generator from #682 - [`c55ecc9`](https://github.com/ubiquitarianism/leonida/commit/c55ecc9cbf4e7cde8b80b032b827e5943d451a9e) d3d12: expand rectangle draws through triangle-family pipelines ### 📊 Changes **5 files changed** (+374 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+4 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+67 -0) ➕ `runtime/src/rect_list_geometry.h` (+268 -0) 📝 `runtime/src/vulkan_replay.h` (+6 -1) 📝 `runtime/test/d3d12_translated_draw_test.cpp` (+29 -1) </details> ### 📄 Description Claimed in the coordination issue as: RT-IA-RECTANGLE-VARIANT ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7131614476)). Depends on: #682 ### What and why The first-run UI compositor binds a triangle-family graphics pipeline, then selects Xbox rectangle-list topology (17) on the input assembler. The three submitted corners drew one triangle. In a 3840 × 2160 pass, this left half the output untouched. Replay now selects a pipeline variant with a generated geometry stage for that draw. The variant cache distinguishes rectangle expansion and the unbound attachment mask. Triangle draws on the same PSO keep their original pipeline. PSOs with the same linked vertex program share the snapshot used to build the geometry stage on first use. The first commit carries only tedin7’s geometry generator from #207 / #682, byte-for-byte, so this can build against current main. The second commit contains the draw-time selection and its regression. The explicit type-19 PSO and quad-list implementation are tracked in #682. ### Tested - Clean main `51f316092` with the new synthetic GPU test fails at pixel (0, 32) on the first rectangle draw. On this branch, the same PSO alternates rectangle and triangle draws twice. All 4,096 target pixels match on each frame. The regression also passes with the Khronos validation layer and synchronization validation enabled. Run `ctest --test-dir <build> -C RelWithDebInfo -R ^d3d12_translated_draw$ --output-on-failure` on a Vulkan-enabled Windows runtime build. - In separate offline runs of a local integration build, selecting the variant raised the two fullscreen passes from 4,147,200 to 8,294,400 fragment invocations each. Swapchain readback went from 926,903 to 1,855,276 non-black pixels out of 1,858,304. A Windows compositor capture independently showed the diagonal cutoff gone and the full row of first-run controller prompts visible. A second launch with the exact generator shipped here produced pixel-identical RGB at the swapchain and, independently, in the Windows window capture. The screen has a plain background. These runs exercise an integration that also includes the constant-buffer row addressing tracked in #513. Gameplay and the 3D world have not been verified. - Full Windows runtime build and all 305 registered CTests. Across the standard run and two validation-enabled reruns, 293 passed and 11 skipped. The remaining `d3d12_vulkan_device` failure reproduced on clean main on this adapter, with identical HRESULT differences for committed-resource flags `0x200` and `0x400`. - The translator suite ran 465 files containing 6,108 tests. The one module that failed to launch `llvm-mc` with a backslash-delimited Windows path passed all nine tests when rerun with a forward-slash `LLVM_MC` path. Viewer streaming passed 57/57 and documentation links passed 16/16. - Repository game-data scan and `git diff --check` pass. Local merge checks against current main and #682 are clean. GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 x64 build 26200 (MSVC RelWithDebInfo). AI-assisted: Yes (Codex). ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] Repository game-data scan passed for all tracked files. - [x] Shader translator rules are unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:58 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#762
No description provided.