Skip to content

d3d12: refuse a pipeline whose shader needs VK_KHR_maintenance8 on a device without it - #9773

Open
Joaco9020 wants to merge 1 commit into
ProjectLeonida:mainfrom
Joaco9020:shader-library-maintenance8
Open

Joaco9020 wants to merge 1 commit into
ProjectLeonida:mainfrom
Joaco9020:shader-library-maintenance8

Conversation

@Joaco9020

Copy link
Copy Markdown
Contributor

Finding: #9677 (comment) (by @evilclanker9000; claimed as soon as the board accepted comments again)

Depends on: none.

What and why

The translator records needs_maintenance8: true for shaders that sample with a texel offset outside a gather (the SPIR-V Offset image operand, tools/rdna2spirv.py), which is valid only with VK_KHR_maintenance8. The runtime never read the field (runtime/src/shader_library.h, ShaderEntry / load()), so on a device without the extension such a pipeline went to the driver as an invalid module instead of being refused with a reason. VulkanDeviceInfo::maintenance8 already says whether the device enabled it.

  • shader_library.h: ShaderEntry::needs_maintenance8, read from the index like uses_code_base (absent or not a boolean: false).
  • d3d12_vulkan_device.cpp: graphics (per stage) and compute pipeline creation refuse such a shader with E_NOTIMPL and one line naming it, beside the existing mesh-limit and workgroup-memory refusals.

Tested

Windows 11, NVIDIA GeForce RTX 3070, driver 621.01, MSVC 19.44 (VS 2022 Build Tools), Vulkan SDK 1.4.363.1, on main 5d74c2723:

No game files.

AI-assisted: yes (Claude).

🤖 Generated with Claude Code

…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: ProjectLeonida#9677 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant