Repository navigation
OLD-9773: d3d12: refuse a pipeline whose shader needs VK_KHR_maintenance8 on a device without it - #1775
OLD-9773: d3d12: refuse a pipeline whose shader needs VK_KHR_maintenance8 on a device without it#1775potatoe0100 wants to merge 1 commit into
Conversation
…device without it The translator records needs_maintenance8 for shaders that sample with a texel offset outside a gather (the SPIR-V Offset image operand), but the runtime never read it: on a device without VK_KHR_maintenance8 such a pipeline went to the driver as invalid SPIR-V. ShaderLibrary::load() now reads the flag, and graphics and compute pipeline creation refuse such a shader with E_NOTIMPL and a reason, as they already do for mesh limits and workgroup memory. Finding: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115210531 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed 88de45b: built and ran shader_library_test on the PR (pass) and on main (pass); copying the PR's test file into a main worktree fails to compile at the new CHECK, and a probe over shader_library.h shows the PR reads needs_maintenance8 from the index (true parsed, non-boolean ignored, absent = false) where main has no such field. All translated modules are picked at the two patched spots, so graphics and compute now refuse the shader with E_NOTIMPL on a device without VK_KHR_maintenance8. d3d12_mesh_test is Windows/Vulkan-only and was not run here - please confirm it ran on a Windows device (its device_info() leaves maintenance8 off). Non-blocking: these refusals bypass stream_unsupported(), so a traced refusal logs "-" as its reason. No finding. AI-assisted review. Recommendation: Merge |
|
Independent verification of head Windows 11 Pro, RTX 4070 SUPER (NVIDIA 621.01), MSVC 19.52.37029, RelWithDebInfo.
Diff read: both the graphics and compute paths check No game files used. AI-assisted (Claude Code). |
Claimed in the coordination issue as: OLD-9773 (#1608 (comment))
What and why
Carries on old PR 9773 by @Joaco9020 (draft #51, branch
old-pr/9773, listed in #17), rebased on currentmainwith the author's commit kept.The translator writes
needs_maintenance8intoindex.jsonfor a shader that samples with a texel offset outside a gather (the SPIR-VOffsetimage operand, valid only withVK_KHR_maintenance8), andvk_pipeline_checkalready reads it, but the D3D12 layer never did: on a device without the extension such a pipeline went to the driver as invalid SPIR-V.ShaderLibrarynow reads the flag intoShaderEntry::needs_maintenance8, and graphics and compute pipeline creation refuse such a shader withE_NOTIMPLand a one-line reason, as they already do for mesh limits and workgroup memory. It is not routed throughLEONIDA_STUB_PIPELINES, which is for shaders with no translation.Rebase notes:
shader_library.hkeepsmain'scode_base_knownhandling and adds the new field and read next to it;shader_library_test.cppadds"needs_maintenance8": truetomain's extendedps_outentry;d3d12_mesh_test.cppkeepsmain's DISPATCH_MESH command-signature check and adds the author's refused/created pipeline pair after it.Tested
ctest: 84 of 85 pass or skip, includingshader_library(which checks the flag is read, and absent means false). The one failure,vk_xdxr_postbuild_readback, is the no-GPU skip returning 77 withoutSKIP_RETURN_CODE, the same onmainand already fixed by runtime: set SKIP_RETURN_CODE 77 on vk_xdxr_postbuild_readback (CI-XDXR-POSTBUILD-SKIP-CODE) #1418.ctest -R "d3d12_mesh|shader_library":shader_libraryandd3d12_meshpass,shader_library_corpusskips (needs game files). Fullctest -j 6: 385 of 385 passed. Two earlier full runs each had one or two failures in tests this change does not touch, which then passed when run alone:d3d12_multithreadran out of device memory once under-j 6,d3d12_depth_stencil_uavcrashed once under-j 3(3 of 3 passes alone), andxmem_write_watch's commit-charge check failed once (1 of 3 alone; known flaky, claimed as TEST-XMEM-COMMIT-CHECK).GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 11 Pro build 26300 (d3d12_mesh_test)
AI-assisted: yes (Claude rebased and tested; the change is Joaco9020's)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: runtime only; the index field is already documented there)🤖 Generated with Claude Code