KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Debug Printf produces no output for shaders created via VK_EXT_shader_object (silent failure, no error)
- Dominant language
- C++
- Stars
- 1k
- Forks
- 504
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 224
Description
## Environment:
GPU: NVIDIA RTX 3500 Ada Generation Laptop GPU, driver 610.188.0
Vulkan API version: 1.4.350
Khronos Validation Layer: v1.4.350
OS: Windows 11 (10.0.26200)
## Description:
VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT correctly instruments shaders bound via a classic VkPipeline, producing printf output as expected. The identical SPIR-V, when instead built into VkShaderEXT objects via vkCreateShadersEXT and bound with vkCmdBindShadersEXT, produces no printf output at all — not even the raw message before any application-side filtering (tested with khronos_validation.printf_to_stdout=true, which bypasses app-level message handling entirely). No validation errors or warnings are reported either — it fails completely silently.
This may be related to [#7178](https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/7178), which shows GPU-AV injecting a descriptor set (index #31) for VK_EXT_shader_object instrumentation and hitting a false-positive compatibility error in the process. Our case differs: no error at all, just zero output — possibly this is what remains after whatever fixed [#7178](https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/7178)'s false positive, if the fix narrowed or disabled the injection for shader objects rather than completing it. Filing as a separate report since the symptoms don't match closely enough to be confident it's the same root cause.
## Repro steps:
1. Minimal vertex+fragment shader pair, fragment shader has one conditional printf(...) (Slang) / debugPrintfEXT(...) (GLSL) call, guarded by a condition guaranteed true for at least one covered fragment.
2. Enable VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT, set printf_to_stdout=true.
3. A — classic pipeline: build via vkCreateGraphicsPipelines from the SPIR-V, bind with vkCmdBindPipeline, draw → printf output appears every frame the condition is met.
4. B — shader objects: same SPIR-V, vkCreateShadersEXT (VK_SHADER_CREATE_LINK_STAGE_BIT_EXT, VK_SHADER_CODE_TYPE_SPIRV_EXT), bind via vkCmdBindShadersEXT with dynamic state from VK_EXT_extended_dynamic_state3, same draw → zero output, headless or windowed, reproduced across multiple independent test runs.
5. Rendering itself is correct in both paths (verified visually) — only the debug-printf instrumentation differs.
Contributor guide
Assessment
This issue has not been assessed yet.