[PR #681] d3d12: select only the needed deferred Vulkan draw pipeline #721

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/681
Author: @QemmHD
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: qemmhd/rt-lazy-attachment-variant


📝 Commits (2)

  • 88658f1 d3d12: LEONIDA_LAZY_PSO=1 builds pipelines at their first draw or dispatch and keeps no unedited shader modules (RT-LAZY-PSO)
  • a3a9b28 d3d12: select the needed deferred draw pipeline

📊 Changes

5 files changed (+250 additions, -41 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+8 -0)
📝 runtime/CMakeLists.txt (+9 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+151 -33)
📝 runtime/src/vulkan_replay.h (+18 -8)
📝 runtime/test/replay_cpu_bench.cpp (+64 -0)

📄 Description

Claimed in #14 as RT-LAZY-ATTACHMENT-VARIANT.

Depends on: #511. This branch keeps the original #511 commit intact. The last commit is the change for review.

What and why

The deferred Vulkan draw path tries the full-attachment pipeline before it knows which attachments are bound. When a target is absent, this can compile two pipelines for one draw. If the full-attachment compile fails, replay rejects the draw before trying its usable variant.

Select the pipeline once after draw validation, using the final attachment mask. Fully bound eager draws still use the pipeline they already have. The CPU replay self-test covers eager draws, fully bound and partial lazy draws, a refused unused base, and an invalid mesh draw.

Tested

  • On #511 with the new fixture, three cases failed: duplicate compilation, premature rejection, and compilation for an invalid draw.
  • With the fix, all seven selection cases passed in replay_cpu_bench_selftest on Windows 11 with MSVC 2022 x64 and Vulkan SDK headers.
  • git diff --check, the repository game-data scan on both changed files, and the merge check against main at 21625bca8 passed.

GPU coverage for this follow-up: CPU replay fixture only.

AI-assisted: yes (Codex).


🔄 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/681 **Author:** [@QemmHD](https://github.com/QemmHD) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `qemmhd/rt-lazy-attachment-variant` --- ### 📝 Commits (2) - [`88658f1`](https://github.com/ubiquitarianism/leonida/commit/88658f1b3fcdca2231358c18d09253a213dc8533) d3d12: LEONIDA_LAZY_PSO=1 builds pipelines at their first draw or dispatch and keeps no unedited shader modules (RT-LAZY-PSO) - [`a3a9b28`](https://github.com/ubiquitarianism/leonida/commit/a3a9b284c63c055f8c5aa1c8b4a0e0f5436b1380) d3d12: select the needed deferred draw pipeline ### 📊 Changes **5 files changed** (+250 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+8 -0) 📝 `runtime/CMakeLists.txt` (+9 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+151 -33) 📝 `runtime/src/vulkan_replay.h` (+18 -8) 📝 `runtime/test/replay_cpu_bench.cpp` (+64 -0) </details> ### 📄 Description Claimed in #14 as [RT-LAZY-ATTACHMENT-VARIANT](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7130582270). Depends on: #511. This branch keeps the original #511 commit intact. The last commit is the change for review. ### What and why The deferred Vulkan draw path tries the full-attachment pipeline before it knows which attachments are bound. When a target is absent, this can compile two pipelines for one draw. If the full-attachment compile fails, replay rejects the draw before trying its usable variant. Select the pipeline once after draw validation, using the final attachment mask. Fully bound eager draws still use the pipeline they already have. The CPU replay self-test covers eager draws, fully bound and partial lazy draws, a refused unused base, and an invalid mesh draw. ### Tested - On #511 with the new fixture, three cases failed: duplicate compilation, premature rejection, and compilation for an invalid draw. - With the fix, all seven selection cases passed in `replay_cpu_bench_selftest` on Windows 11 with MSVC 2022 x64 and Vulkan SDK headers. - `git diff --check`, the repository game-data scan on both changed files, and the merge check against `main` at `21625bca8` passed. GPU coverage for this follow-up: CPU replay fixture only. AI-assisted: yes (Codex). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#721
No description provided.