[PR #1630] [MERGED] d3d12: real SO_STATISTICS query pools (D3D-302) #1644

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

📋 Pull Request Information

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

Base: main ← Head: stream-output


📝 Commits (5)

  • e5a4976 d3d12: real SO_STATISTICS query pools (D3D-302)
  • 369bb1c d3d12: gate SO_STATISTICS pools and refuse per-stream overlap (D3D-302)
  • 6af9c80 d3d12: refuse an active SO stream across heaps too (D3D-302)
  • dd6d3fd Merge main into stream-output (#1630)
  • 844519a Merge main into stream-output (#1630)

📊 Changes

7 files changed (+231 additions, -34 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+13 -8)
📝 runtime/shims/d3d12_com.h (+12 -5)
📝 runtime/shims/d3d12_vulkan_device.cpp (+28 -9)
📝 runtime/src/vulkan_backend.h (+12 -1)
📝 runtime/src/vulkan_replay.h (+60 -8)
📝 runtime/test/d3d12_vulkan_device_test.cpp (+5 -2)
📝 runtime/test/replay_query_predication_test.cpp (+101 -1)

📄 Description

Claimed in the coordination issue as: D3D-302 (claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163085669)
Depends on: #1891

Lands only the real SO_STATISTICS query-pool part, on its own (the option aslan2142 offered). StreamOutput PSOs are still refused and SOSetTargets is still not implemented; the capture path is not part of this PR.

The device detect/enable and the vk_pipeline_check parity fix now live in #1891 (which adopts #1236). This PR is stacked on it and contains only the query pools:

  • With VK_EXT_transform_feedback enabled (by #1891), an SO_STATISTICS heap is a real VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT pool, begun and ended indexed on the stream (vkCmdBeginQueryIndexedEXT / vkCmdEndQueryIndexedEXT).
  • ResolveQueryData copies the two 64-bit results (NumPrimitivesWritten, PrimitivesStorageNeeded), 16 bytes per query, in the same order.
  • Without the feature, the heap is made without a VkQueryPool and resolves zeros, as before.

When #1891 merges I will rebase this onto main; the two foundation commits drop and only the query changes remain.

The remaining pipeline_cache_seed failure on AMD is neither this PR nor #1891: adrianmjim rechecked on an RX 7900 XT and it fails identically on the base main without either, from #1723's robustBufferAccess change. That is #1833, where I flagged a checker-vs-runtime bindless input mismatch (the checker's OR of update-after-bind flags vs the runtime's six-feature AND) to correct before relying on it.

Tested on main 71a769d7d (Windows 11 Pro 26300, MSVC RelWithDebInfo, NVIDIA RTX 3080 Ti, driver 616.64, Vulkan SDK 1.4.363.0): d3d12_vulkan_device, d3d12_mesh and pipeline_cache_seed pass, plain and with LEONIDA_VK_VALIDATION=1. AI-assisted.


🔄 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/1630 **Author:** [@BubsMcgee](https://github.com/BubsMcgee) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `stream-output` --- ### 📝 Commits (5) - [`e5a4976`](https://github.com/ubiquitarianism/leonida/commit/e5a49762248fdebb0575c1b9e07bbb1a1fcf126b) d3d12: real SO_STATISTICS query pools (D3D-302) - [`369bb1c`](https://github.com/ubiquitarianism/leonida/commit/369bb1c753e312b2ffe796fa79f1a13dbea63188) d3d12: gate SO_STATISTICS pools and refuse per-stream overlap (D3D-302) - [`6af9c80`](https://github.com/ubiquitarianism/leonida/commit/6af9c80a990c6543a4593665d2465f2f14b502e7) d3d12: refuse an active SO stream across heaps too (D3D-302) - [`dd6d3fd`](https://github.com/ubiquitarianism/leonida/commit/dd6d3fd8a5c61840e822aa6469214c65c534cd7b) Merge main into stream-output (#1630) - [`844519a`](https://github.com/ubiquitarianism/leonida/commit/844519ab597c910797606f14ea10e0d95e99210e) Merge main into stream-output (#1630) ### 📊 Changes **7 files changed** (+231 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+13 -8) 📝 `runtime/shims/d3d12_com.h` (+12 -5) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+28 -9) 📝 `runtime/src/vulkan_backend.h` (+12 -1) 📝 `runtime/src/vulkan_replay.h` (+60 -8) 📝 `runtime/test/d3d12_vulkan_device_test.cpp` (+5 -2) 📝 `runtime/test/replay_query_predication_test.cpp` (+101 -1) </details> ### 📄 Description Claimed in the coordination issue as: D3D-302 (claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163085669) Depends on: #1891 Lands only the real `SO_STATISTICS` query-pool part, on its own (the option aslan2142 offered). StreamOutput PSOs are still refused and `SOSetTargets` is still not implemented; the capture path is not part of this PR. The device detect/enable and the `vk_pipeline_check` parity fix now live in **#1891** (which adopts #1236). This PR is stacked on it and contains only the query pools: - With `VK_EXT_transform_feedback` enabled (by #1891), an `SO_STATISTICS` heap is a real `VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT` pool, begun and ended indexed on the stream (`vkCmdBeginQueryIndexedEXT` / `vkCmdEndQueryIndexedEXT`). - `ResolveQueryData` copies the two 64-bit results (`NumPrimitivesWritten`, `PrimitivesStorageNeeded`), 16 bytes per query, in the same order. - Without the feature, the heap is made without a `VkQueryPool` and resolves zeros, as before. When #1891 merges I will rebase this onto `main`; the two foundation commits drop and only the query changes remain. The remaining `pipeline_cache_seed` failure on AMD is neither this PR nor #1891: adrianmjim rechecked on an RX 7900 XT and it fails identically on the base `main` without either, from #1723's `robustBufferAccess` change. That is #1833, where I flagged a checker-vs-runtime `bindless` input mismatch (the checker's OR of update-after-bind flags vs the runtime's six-feature AND) to correct before relying on it. Tested on `main` `71a769d7d` (Windows 11 Pro 26300, MSVC RelWithDebInfo, NVIDIA RTX 3080 Ti, driver 616.64, Vulkan SDK 1.4.363.0): `d3d12_vulkan_device`, `d3d12_mesh` and `pipeline_cache_seed` pass, plain and with `LEONIDA_VK_VALIDATION=1`. AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:21:57 +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#1644
No description provided.