Cap 1884 fixed #1925

Closed
github-bot wants to merge 5 commits from gh-pr/1925/head into gh-pr/1925/base
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 15:54 UTC · original
BubsMcgee:cap-1884-fixed → main · +511 −11 · 13 files · 5 commits · closed without merging

Claimed in the coordination issue as:

Depends on:

Fixes:

What and why

Tested

GPUs tested:

AI-assisted:

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.
**@⁠BubsMcgee** on GitHub · 2026-11-25 15:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1925) `BubsMcgee:cap-1884-fixed` → `main` · +511 −11 · 13 files · 5 commits · closed without merging Claimed in the coordination issue as: <!-- the item ID from the open "Coordinating who works on what" issue, for example TEST-17, or a link to your claim --> Depends on: <!-- #N for every pull request this one builds on or conflicts with (the coordination issue's Commands section, AGENTS.md); delete the line if it builds on none and conflicts with none --> Fixes: <!-- #N for each issue this closes (GitHub closes it on merge); delete the line if it closes none --> ### What and why <!-- What this changes and the problem it solves. --> ### Tested <!-- What you ran and on which GPU and driver (CONTRIBUTING.md). For the shader translator: how many shaders translate and pass spirv-val, before and after. --> GPUs tested: <!-- vendor, model, driver and OS of each GPU the GPU tests ran on, or n/a --> AI-assisted: <!-- yes or no (AGENTS.md asks a coding agent to say so) --> ### 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.
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]>
The runtime's device enables VK_EXT_transform_feedback whenever the extension is present, and AMD's driver makes it part of a pipeline's cache key, so the cache vk_pipeline_check seeds offline no longer hit in gta6rt: pipeline_cache_seed failed 3/3 on an RX 7900 XT (adrianmjim). Link the same VkPhysicalDeviceTransformFeedbackFeaturesEXT the runtime enables, next to the mesh-shader one, and list it with the other always-enabled extensions in the header and docs/pipeline_check.md.

Tested: pipeline_cache_seed passes on an NVIDIA RTX 3080 Ti (NVIDIA does not key on the extension, so it cannot reproduce the AMD failure). AI-assisted.
Addresses Snooozs's review on #1236: the comments and the log line no longer claim StreamOutput PSO acceptance, SOSetTargets or capture that this foundation does not have. #1630 adds the SO_STATISTICS query pools that use it.
Builds on D3D-TRANSFORM-FEEDBACK-DEVICE (the device-capability plumbing): a
graphics PSO that declares StreamOutput is now accepted instead of refused
(the common case only: RasterizedStream 0, NumStrides within the device's
maxTransformFeedbackBuffers), SOSetTargets stores the bound buffers on the
command list the same way IASetVertexBuffers does, and a draw with a pipeline
that has StreamOutput and every declared buffer slot bound wraps itself in
vkCmdBindTransformFeedbackBuffersEXT + vkCmdBeginTransformFeedbackEXT /
vkCmdEndTransformFeedbackEXT, writing real captured data.

Not done, left as follow-up:
- RasterizedStream other than 0 (needs VkPipelineRasterizationStateStreamCreateInfoEXT
  / rasterizerDiscardEnable at pipeline creation)
- SO_STATISTICS queries (still stubbed to 0; the real wiring is
  VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT with the indexed
  vkCmdBeginQueryIndexedEXT/EndQueryIndexedEXT commands)
- Matching a real translated game shader's output semantics to StreamOutput
  buffer slots, which needs patching Xfb decorations into its SPIR-V at PSO
  creation time (the translator runs before any PSO exists, so it cannot know
  this ahead of time) - this PR's own test uses a hand-written GLSL shader
  with the decorations already in place, not a translated one

New test d3d12_stream_output_test.cpp: a StreamOutput PSO with a hand-written
vertex shader (runtime/test/glsl/vs_stream_output.vert, Xfb-decorated,
writes the fixed vec4 (1,2,3,4)) draws 3 vertices; the buffer SOSetTargets
bound is read back and every vertex's 16 bytes are checked against that
constant. 0 mismatches on real hardware.

Full ctest run (runtime/build, RelWithDebInfo): 307/308 pass (one more test
than main, the new one); the only failure is the pre-existing
d3d12_execute_indirect_validation (#504, fixed by the separate PR #1066,
unrelated to this change). No regressions.

GPU: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11 26300.9974.

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

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

Closing as a duplicate of #1884 by Miici0: this branch carries its commits plus the vk_pipeline_check parity, which #1891 already has. No unique content, and two copies of the same feature force everyone to review both. #1884 is the one to rebase and land; the branch stays on the fork.

**@⁠BubsMcgee** on GitHub · 2026-11-25 17:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1925#issuecomment-7169103065) Closing as a duplicate of #1884 by Miici0: this branch carries its commits plus the vk_pipeline_check parity, which #1891 already has. No unique content, and two copies of the same feature force everyone to review both. #1884 is the one to rebase and land; the branch stays on the fork.

Pull request closed

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