Repository navigation
runtime: graphics pipelines on a Vulkan 1.2 device through VK_EXT_extended_dynamic_state(2) (RT-121) - #1924
Conversation
…ended_dynamic_state(2) The graphics pipelines use the Vulkan 1.3 core dynamic states (primitive topology, primitive restart, vertex binding stride) and their commands (vkCmdBindVertexBuffers2, vkCmdSetPrimitiveTopology, vkCmdSetPrimitiveRestartEnable). On a Vulkan 1.2 device these come from VK_EXT_extended_dynamic_state and VK_EXT_extended_dynamic_state2, with the same values and signatures. Vulkan13Features now enables both where the device has them, and device_proc_or_khr also tries the EXT name. Without them a 1.2 device still works for compute, and graphics pipelines are refused as before. AI-assisted. No game files.
Serrambi
left a comment
There was a problem hiding this comment.
Reviewed 15901c66 and tested on NVIDIA GeForce RTX 5070 Ti (Vulkan 1.3, driver 610.88, Windows 11 Pro, MSVC 19.50.35719.0, Vulkan SDK 1.4.363.0): approve.
Code review (runtime/src/vulkan13_features.h, runtime/src/vulkan_backend.h, runtime/shims/d3d12_vulkan_device.cpp, runtime/test/vk_test_device.h)
Vulkan13Featurescleanly handles physical-device selection, feature enabling (enable()/next()), and extension registration for Vulkan 1.3 (core == true) as well as Vulkan 1.2 +VK_KHR_dynamic_rendering+VK_KHR_synchronization2.- Requiring both
VK_EXT_extended_dynamic_stateandVK_EXT_extended_dynamic_state2(extended_dynamic_state) accurately matches the entry points checked inVulkanDeviceFunctions::graphics_complete()(vkCmdBindVertexBuffers2,vkCmdSetPrimitiveTopology, andvkCmdSetPrimitiveRestartEnable), while keeping compute-only devices usable without them. device_proc_or_khr()tries core →KHR→EXTcleanly in bothVulkanDeviceFunctions::load()andvktest::Device::fn().- Note: RTX 5070 Ti exercises the Vulkan 1.3 (
core == true) path at runtime; the Vulkan 1.2 KHR/EXT fallback path was verified by code inspection.
Checks on 15901c66
ctest --test-dir runtime/build --output-on-failure -R "^(vk_command_replay|d3d12_draw|d3d12_compute|d3d12_vulkan_device|d3d12_translated_draw|d3d12_m2_textured|d3d12_m3_frame|d3d12_subgroup)$"(default):7/7passed (d3d12_vulkan_device,d3d12_translated_draw,d3d12_m2_textured,d3d12_m3_frame,d3d12_compute,d3d12_draw,d3d12_subgroup).- Same
ctestsubset underLEONIDA_VK_VALIDATION=1:6/7passed with 0 validation errors (onlyd3d12_drawfailed on the pre-existingfence signal 21 is not above 30/VUID-vkDestroyPipeline-pipeline-00765issue frommain).
|
Tested
|
|
Tested 15901c6 on an NVIDIA GeForce RTX 3050 Laptop GPU, driver 32.0.16.2101, Windows 11, native MSVC (VS 2022 Build Tools, Ninja, RelWithDebInfo), with
AI-assisted (Claude Code). |
Tested
|
| Commit | 15901c66 (main 4eb6155d merged in) |
| GPU | NVIDIA GeForce RTX 4060 Laptop GPU |
| Driver | 617.42, Vulkan 1.4.351 |
| OS | Windows 11 Pro 26300 |
| Build | MSVC (VS 2022 Build Tools) + Ninja, RelWithDebInfo |
| Vulkan SDK | 1.4.363.1 |
| Device pinning | VK_LOADER_DRIVERS_SELECT=nv-vk*, LEONIDA_VK_DEVICE=4060, LEONIDA_HOST_ADAPTER=4060, VK_LOADER_LAYERS_DISABLE=~implicit~ |
| Game files | None |
Results
Full ctest, run twice: without validation, and with LEONIDA_VK_VALIDATION=1.
| Run | Passed | Failed | Skipped / disabled |
|---|---|---|---|
| No validation | 102 | 1 | 8 |
LEONIDA_VK_VALIDATION=1 |
103 | 1 | 7 |
vk_sync_validation passes with validation on, so synchronization validation is active.
The one failure: d3d12_draw, not caused by this PR
bundle blend pixel (0, 0): got 127,0,127,255, expected red 64
With validation it also reports VUID-vkDestroyPipeline-pipeline-00765 (a pipeline destroyed while still in use). That is the only validation message in the whole run.
| Build | d3d12_draw |
VUID-00765 |
|---|---|---|
main 4eb6155d |
fails, 3/3 runs | yes |
| this PR | fails, 3/3 runs | yes |
| this PR + #1995 | passes, 3/3 runs | no |
The failure is #1966, and #1995 fixes it.
Skipped
shader_library_corpus,bink_decode,bink_audio,fsr_dispatch,bvh_builder: need the package (LEONIDA_GAME_DIRnot set).d3d12_rgb9e5_rtv: "RGB9E5 render targets unavailable on this adapter".gameinput: disabled (built without SDL3).
|
Tested 3db0860 natively on Windows with NVIDIA and AMD: pass, no regressions on Vulkan 1.3+ drivers. This is the "on 1.3 nothing changes" side; the 1.2 EXT path isn't exercised here. Setup: Windows 11 Pro 10.0.26300, MSVC 19.44.35230 (VS 2022 Build Tools), Vulkan SDK 1.4.363.0,
AI-assisted (Claude Code). |
|
Tested 3db0860, merged onto
This card is a Vulkan 1.4 device, so this covers the core path ( AI-assisted (Claude Code). |
…OC-155 review) CrossOver on arm64 (FEX) or x86-64 (Rosetta), from merged ItsNotRexed#1706, ItsNotRexed#1707 and ItsNotRexed#1924, with ItsNotRexed#3119 open for the last loader tests; suggested in review.
Claimed in the coordination issue as: RT-121 (claim, recorded in #1745)
Follow-up to #1706 (merged);
mainis merged in, so the diff is only this change.What and why
With #1706, a Vulkan 1.2 device such as CrossOver's MoltenVK 1.2.10 (macOS, arm64 Wine) is accepted, but
CreateGraphicsPipelineStateis still refused ("graphics pipelines need Vulkan 1.3 dynamic rendering and extended dynamic state"). The graphics pipelines use the 1.3 core dynamic states (primitive topology, primitive restart, vertex binding stride) and their commands (vkCmdBindVertexBuffers2,vkCmdSetPrimitiveTopology,vkCmdSetPrimitiveRestartEnable). On 1.2 they come fromVK_EXT_extended_dynamic_stateandVK_EXT_extended_dynamic_state2, with the same enum values and signatures.Vulkan13Features(from runtime: accept a Vulkan 1.2 device with VK_KHR_dynamic_rendering and VK_KHR_synchronization2 #1706) queries both EXT feature structs on a 1.2 device and, where the device has both, enables them and adds the two extensions (extended_dynamic_state). On 1.3 they are core and nothing changes.device_proc_or_khrtries the core name, then the KHR name, then the EXT name.Tested
Cross-built with clang-cl 22.1.8 + lld + xwin, run under CrossOver Preview 20260821 (arm64 Wine + FEX, MoltenVK 1.2.10) on an Apple M2 Max, full ctest (107 tests) compared with #1706 at the same commit:
d3d12_subgroupnow passes.MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1(MoltenVK 1.2.x has Metal argument buffers off by default; the bindless set needs them):d3d12_m2_textured,d3d12_m3_frame,d3d12_set0_computeandd3d12_subgroupnow pass.d3d12_drawpasses too once TEST-266 (fix(test): use monotonic fence value (31) for bundle blend pass in d3d12_draw_test #1807) is applied; onmainit fails everywhere for that reason.d3d12_descriptorandd3d12_r9g9b9e5_uav(bindless set larger than MoltenVK 1.2.10 can place in an argument buffer), the occlusion tests (also fail with that MoltenVK natively), and the Mac/Wine items others own (D3D-245, D3D-246, D3D-165).Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator rule.)AI-assisted. No game files.