d3d12_vulkan_device: detect and enable VK_EXT_transform_feedback (D3D-TRANSFORM-FEEDBACK-DEVICE) #1236

Closed
github-bot wants to merge 1 commit from gh-pr/1236/head into gh-pr/1236/base
Owner

@⁠Miici0 on GitHub · 2026-11-24 20:40 UTC · original
Miici0:feat/d3d-transform-feedback-device → main · +30 −0 · 2 files · 1 commits · closed without merging

Claimed in the coordination issue as: D3D-TRANSFORM-FEEDBACK-DEVICE (#14)

Depends on: none

Fixes: none

What and why

Foundation for D3D-302 (stream output, docs/d3d12_vulkan.md): detects VK_EXT_transform_feedback and reads its transformFeedback/geometryStreams features on the physical device where the extension is present, records them on the new VulkanDeviceInfo::transform_feedback / transform_feedback_geometry_streams fields, and enables them on the logical device - the same detect/record/enable pattern the existing VK_EXT_mesh_shader code already uses a few lines above.

This is device-capability plumbing only, no behaviour change: a graphics PSO that declares StreamOutput is still refused with E_NOTIMPL and SOSetTargets is still not implemented, exactly as on main today. Actually implementing stream output (accepting the PSO, binding real buffers in SOSetTargets, wrapping draws in vkCmdBeginTransformFeedbackEXT/EndTransformFeedbackEXT, and wiring the SO_STATISTICS queries to VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT) is separate, larger follow-up work.

Tested

ctest --test-dir runtime/build -C RelWithDebInfo -R "d3d12_vulkan_device|d3d12_mesh|xbox_present_readback_size": 3/3 pass. Full runtime/build compiles clean (these two files are included by ~100 translation units; all rebuilt without warnings from this change).

A standalone probe confirmed VK_EXT_transform_feedback is available on this GPU with transformFeedback/geometryStreams both true, maxTransformFeedbackStreams/maxTransformFeedbackBuffers both 4 - matching D3D12's stream-output model (4 streams, 4 buffers) exactly, so there's no capability mismatch to work around when the real implementation lands.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11 26300.9974, Vulkan SDK 1.4.363.1.

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work (the actual stream-output implementation) goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • N/A: no new translator rule.
**@⁠Miici0** on GitHub · 2026-11-24 20:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236) `Miici0:feat/d3d-transform-feedback-device` → `main` · +30 −0 · 2 files · 1 commits · closed without merging Claimed in the coordination issue as: D3D-TRANSFORM-FEEDBACK-DEVICE (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Depends on: none Fixes: none ### What and why Foundation for D3D-302 (stream output, docs/d3d12_vulkan.md): detects `VK_EXT_transform_feedback` and reads its `transformFeedback`/`geometryStreams` features on the physical device where the extension is present, records them on the new `VulkanDeviceInfo::transform_feedback` / `transform_feedback_geometry_streams` fields, and enables them on the logical device - the same detect/record/enable pattern the existing `VK_EXT_mesh_shader` code already uses a few lines above. This is device-capability plumbing only, no behaviour change: a graphics PSO that declares `StreamOutput` is still refused with `E_NOTIMPL` and `SOSetTargets` is still not implemented, exactly as on `main` today. Actually implementing stream output (accepting the PSO, binding real buffers in `SOSetTargets`, wrapping draws in `vkCmdBeginTransformFeedbackEXT`/`EndTransformFeedbackEXT`, and wiring the `SO_STATISTICS` queries to `VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT`) is separate, larger follow-up work. ### Tested `ctest --test-dir runtime/build -C RelWithDebInfo -R "d3d12_vulkan_device|d3d12_mesh|xbox_present_readback_size"`: 3/3 pass. Full `runtime/build` compiles clean (these two files are included by ~100 translation units; all rebuilt without warnings from this change). A standalone probe confirmed `VK_EXT_transform_feedback` is available on this GPU with `transformFeedback`/`geometryStreams` both true, `maxTransformFeedbackStreams`/`maxTransformFeedbackBuffers` both 4 - matching D3D12's stream-output model (4 streams, 4 buffers) exactly, so there's no capability mismatch to work around when the real implementation lands. GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11 26300.9974, Vulkan SDK 1.4.363.1. AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work (the actual stream-output implementation) goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [ ] N/A: no new translator rule.
Foundation for D3D-302 (stream output): read the physical device's
transformFeedback/geometryStreams features where the extension is
present, record them on VulkanDeviceInfo, and enable them on the
logical device when supported, exactly the same pattern the existing
VK_EXT_mesh_shader detection/enable code already follows.

Device-capability plumbing only: no behaviour changes yet. A graphics
PSO declaring StreamOutput is still refused and SOSetTargets is still
not implemented, same as before this commit. Confirmed
VK_EXT_transform_feedback is available (4 streams, 4 buffers) on an
NVIDIA GeForce RTX 4070 SUPER, driver 621.24.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:43:58 +00:00
github-bot closed this pull request 2026-11-26 09:43:58 +00:00
Author
Owner

@⁠Snooozs on GitHub · 2026-11-24 21:29 UTC · original

Read the whole diff and tested c99f26559 merged on main 6261ca916 (clean): Windows 10 Pro 19045, VS 2022 RelWithDebInfo, LEONIDA_VK_VALIDATION=1.

  • RTX 5060 Ti (NVIDIA 621.01): d3d12_vulkan_device and d3d12_mesh pass, 0 VUID lines.
  • Ryzen 7 7700 iGPU (AMD 31.0.22044.1): d3d12_vulkan_device exits 1 as on main; d3d12_mesh stops at its first pipeline (144 push-constant bytes, 128 available), before anything this PR could affect. Device creation works with the extra feature enabled, no VUID lines.

One thing to change: the comments describe behaviour this PR doesn't have. d3d12_com.h says that with transform_feedback "a graphics PSO that declares StreamOutput is accepted, SOSetTargets binds real buffers, and draws between them are captured", and that geometryStreams lets another RasterizedStream be rasterized; the description says StreamOutput PSOs are still refused and SOSetTargets isn't implemented. The stderr line has the same problem the other way round: without the extension it says StreamOutput PSOs are unsupported, which reads as if they work with it. "Detected and enabled; nothing uses it yet" would fit, and the log line could come with the implementation.

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

**@⁠Snooozs** on GitHub · 2026-11-24 21:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7145001178) Read the whole diff and tested `c99f26559` merged on main `6261ca916` (clean): Windows 10 Pro 19045, VS 2022 RelWithDebInfo, `LEONIDA_VK_VALIDATION=1`. - RTX 5060 Ti (NVIDIA 621.01): `d3d12_vulkan_device` and `d3d12_mesh` pass, 0 VUID lines. - Ryzen 7 7700 iGPU (AMD 31.0.22044.1): `d3d12_vulkan_device` exits 1 as on main; `d3d12_mesh` stops at its first pipeline (144 push-constant bytes, 128 available), before anything this PR could affect. Device creation works with the extra feature enabled, no VUID lines. One thing to change: the comments describe behaviour this PR doesn't have. `d3d12_com.h` says that with `transform_feedback` "a graphics PSO that declares StreamOutput is accepted, SOSetTargets binds real buffers, and draws between them are captured", and that `geometryStreams` lets another `RasterizedStream` be rasterized; the description says StreamOutput PSOs are still refused and `SOSetTargets` isn't implemented. The stderr line has the same problem the other way round: without the extension it says StreamOutput PSOs are unsupported, which reads as if they work with it. "Detected and enabled; nothing uses it yet" would fit, and the log line could come with the implementation. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 11:52 UTC · original

Heads-up for when this lands: enabling VK_EXT_transform_feedback makes pipeline_cache_seed fail on AMD (RX 7900 XT, 3/3) because vk_pipeline_check does not link the same VkPhysicalDeviceTransformFeedbackFeaturesEXT (transformFeedback, and geometryStreams when the device offers it), and AMD keys the pipeline cache on it. The fix is in #1630 commit ed7ab37a6: link the feature next to the mesh-shader one and list it in docs/pipeline_check.md ("The cache and the runtime's device"). NVIDIA does not key on it, so it does not show up on a 3080 Ti.

Also noting the label workflow here is currently failing ("Needs rebase label").

**@⁠BubsMcgee** on GitHub · 2026-11-25 11:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7161614828) Heads-up for when this lands: enabling `VK_EXT_transform_feedback` makes `pipeline_cache_seed` fail on AMD (RX 7900 XT, 3/3) because `vk_pipeline_check` does not link the same `VkPhysicalDeviceTransformFeedbackFeaturesEXT` (`transformFeedback`, and `geometryStreams` when the device offers it), and AMD keys the pipeline cache on it. The fix is in #1630 commit `ed7ab37a6`: link the feature next to the mesh-shader one and list it in `docs/pipeline_check.md` ("The cache and the runtime's device"). NVIDIA does not key on it, so it does not show up on a 3080 Ti. Also noting the `label` workflow here is currently failing ("Needs rebase label").
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 12:59 UTC · original

Tested #1236 merged onto current main 98c2f7777 (Windows 11 Pro build 26300, MSVC RelWithDebInfo, NVIDIA RTX 3080 Ti, driver 616.64, Vulkan SDK 1.4.363.0):

  • d3d12_vulkan_device — Passed
  • d3d12_mesh — Passed

Both also pass with LEONIDA_VK_VALIDATION=1 (Khronos validation layer active), with no VUIDs.

The PR is MERGEABLE; the only check is the label workflow, which is cancelled (not a code failure), and no rebase is needed. Looks ready to merge. #1630 will then rebase onto it and drop its duplicated device setup.

(The AMD pipeline_cache_seed key for the new extension is the vk_pipeline_check change in #1630; the separate robustBufferAccess mismatch from #1723 is #1833.)

AI-assisted.

**@⁠BubsMcgee** on GitHub · 2026-11-25 12:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7163137881) Tested #1236 merged onto current `main` `98c2f7777` (Windows 11 Pro build 26300, MSVC RelWithDebInfo, NVIDIA RTX 3080 Ti, driver 616.64, Vulkan SDK 1.4.363.0): - `d3d12_vulkan_device` — Passed - `d3d12_mesh` — Passed Both also pass with `LEONIDA_VK_VALIDATION=1` (Khronos validation layer active), with no VUIDs. The PR is `MERGEABLE`; the only check is the `label` workflow, which is `cancelled` (not a code failure), and no rebase is needed. Looks ready to merge. #1630 will then rebase onto it and drop its duplicated device setup. (The AMD `pipeline_cache_seed` key for the new extension is the `vk_pipeline_check` change in #1630; the separate `robustBufferAccess` mismatch from #1723 is #1833.) AI-assisted.
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 14:40 UTC · original

Adopted into #1891: the device commit is unchanged and credited to @⁠Miici0, with the vk_pipeline_check parity fix on top, because this PR has been stuck waiting on workflow approval. If you would rather keep this PR, say so and I will back #1891 out; otherwise the maintainer can merge #1891 and close this (I cannot close it myself).

AI-assisted.

**@⁠BubsMcgee** on GitHub · 2026-11-25 14:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7165628689) Adopted into #1891: the device commit is unchanged and credited to @⁠Miici0, with the `vk_pipeline_check` parity fix on top, because this PR has been stuck waiting on workflow approval. If you would rather keep this PR, say so and I will back #1891 out; otherwise the maintainer can merge #1891 and close this (I cannot close it myself). AI-assisted.
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 14:58 UTC · original

Addressed Snooozs's review in #1891 (adopted commit + follow-up): the comments and log now say detected/enabled, nothing uses it yet. Thanks for the catch.

**@⁠BubsMcgee** on GitHub · 2026-11-25 14:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7166097204) Addressed Snooozs's review in #1891 (adopted commit + follow-up): the comments and log now say detected/enabled, nothing uses it yet. Thanks for the catch.
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 15:51 UTC · original

Superseded by #1891: the same device detect/enable commit, unchanged, plus the vk_pipeline_check parity fix and Snooozs's comment/log correction. #1891 is the foundation in the TF merge order (note on #1608). With that, this can close.

AI-assisted.

**@⁠BubsMcgee** on GitHub · 2026-11-25 15:51 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7167370437) Superseded by #1891: the same device detect/enable commit, unchanged, plus the `vk_pipeline_check` parity fix and Snooozs's comment/log correction. #1891 is the foundation in the TF merge order (note on #1608). With that, this can close. AI-assisted.
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 17:11 UTC · original

Note for the queue: #1891 adopts this commit verbatim (the detect/enable code is credited to Miici0) because the workflow approval was stuck, and it is now CLEAN. With #1891 open, this one is redundant and would be reviewed twice; closing it is the author's/maintainer's call, I am only flagging it.

**@⁠BubsMcgee** on GitHub · 2026-11-25 17:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7169147946) Note for the queue: #1891 adopts this commit verbatim (the detect/enable code is credited to Miici0) because the workflow approval was stuck, and it is now CLEAN. With #1891 open, this one is redundant and would be reviewed twice; closing it is the author's/maintainer's call, I am only flagging it.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 22:32 UTC · original

Thanks for this! It landed through #1891, which adopted it with the vk_pipeline_check parity fix (merged as 1bf5eeafd), so I'm closing this one as included.

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

**@⁠aslan2142** on GitHub · 2026-11-25 22:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1236#issuecomment-7176496087) Thanks for this! It landed through #1891, which adopted it with the `vk_pipeline_check` parity fix (merged as `1bf5eeafd`), so I'm closing this one as included. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.