mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 01:00:53 +01:00
[PR #1549] d3d12: LEONIDA_STUB_PIPELINES builds a real graphics pipeline from built-in stages (MVP-GPU-04) #1576
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1576
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1549
Author: @Mike7581
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:mvp-gpu-04-stub-pipeline📝 Commits (2)
78159b8d3d12: LEONIDA_STUB_PIPELINES builds a real graphics pipeline from built-in stages (MVP-GPU-04)bbc7506d3d12: stub draws only for this device's mesh stubs; =color stubs override the state that hides them📊 Changes
8 files changed (+875 additions, -29 deletions)
View changed files
📝
docs/boot.md(+13 -5)📝
runtime/CMakeLists.txt(+9 -1)📝
runtime/shims/d3d12_com.cpp(+9 -4)📝
runtime/shims/d3d12_com.h(+5 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+124 -13)➕
runtime/src/stub_pipeline.h(+222 -0)➕
runtime/test/d3d12_stub_draw_test.cpp(+487 -0)📝
runtime/test/d3d12_stub_pipelines_test.cpp(+6 -6)📄 Description
Claimed in the coordination issue as: MVP-GPU-04 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151252490)
What and why
MVP-GPU-04 asks for a stub pipeline for the first draw: a minimal VS/PS that passes validation.
Today
LEONIDA_STUB_PIPELINES=1creates a graphics PSO whose translated shader is missing with no Vulkan pipeline and never registers it. Its draws did not become no-ops as the comment ind3d12_com.cppsaid:record_drawrefused them (!graphics_pipeline_), so the whole list failed to close. Only dispatches were skipped.With this change a vertex pipeline with a missing translation (no shader library, or no entry for its FSSM/FSPX program) takes a vertex and a pixel stage from the new
runtime/src/stub_pipeline.hand goes through the normalcreate_graphicspath: registered, built eagerly (the lazy path reads stages from the library again), drawn through replay and the validation layer.LEONIDA_STUB_PIPELINES=1: the vertex stage puts every vertex outside the clip volume, so a draw changes no pixel (the old intent), but the render pass, attachments, layouts and push constants are real.LEONIDA_STUB_PIPELINES=color: every three vertices cover the viewport and the pixel stage writes magenta (1 to UINT/SINT targets) to each render target, so stubbed passes show on screen.depth24_depth_only_fragment), no compiler at build time. No set 0, no code base, no vertex input read; the 144-byte push range is kept. Point-list PSOs get a PointSize write. Position is a bare output, sorect_list_geometrytakes it.record_drawandDispatchMeshnow skip a draw on an unregistered pipeline, asrecord_dispatchalready did, instead of failing the list.docs/boot.mddescribes the switch.The MVP table names
runtime/src/vulkan_pipeline.cpp; that file does not exist, the code is inruntime/shims/d3d12_vulkan_device.cpp(create_graphics).Tested
d3d12_stub_draw_test: no shader library; PSOs created with the switch off (E_FAIL),=1(triangle and point list) and=color; draws into an R8G8B8A8_UNORM and an R32_UINT target and reads both back.=1leaves blue / 7 on all 4096 pixels,=colorgives magenta / 1 on all 4096 pixels.d3d12_stub_pipelines_testnow expects a registered graphics pipeline.LEONIDA_VK_VALIDATION=1and no validation message (the test fails on any).cteston this branch rebased onbfef489c: 378/378 passed.GPUs tested: NVIDIA GeForce RTX 4050 Laptop GPU, driver 621.40 (32.0.16.2140), Vulkan SDK 1.4.363.0, Windows 11 Pro 10.0.26200, MSVC (VS 2022 Build Tools 17.14) + Ninja via
scripts\build_runtime.ps1AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.