KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
debugPrintfEXT - missing output for pass with previously bound but unused descriptor set
- Dominant language
- C++
- Stars
- 1k
- Forks
- 504
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 224
Description
**Environment:**
- OS: Windows 11
- GPU and driver version: NVIDIA RTX 2070 Super 561.09
- SDK or header version if building from repo: 1.3.296
- Options enabled (synchronization, best practices, etc.): `debugPrintfEXT`
**Describe the Issue**
Compute dispatches that do not use any descriptor sets (e.g., because buffers are accessed with a buffer device address) do not output any messages from `debugPrintfEXT` **if a descriptor set was bound for a previous compute pass**.
```c++
// 1st compute pass: binds a descriptor set
vkCmdBindPipeline(cmd, pipeline0, VK_PIPELINE_BIND_POINT_COMPUTE);
vkCmdBindDescriptorSet(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, ...);
vkCmdDispatch(cmd, ...); // debugPrintfEXT here works
// 2nd compute pass: does not require any descriptor sets (but previous set is still bound)
vkCmdBindPipeline(cmd, pipeline1, VK_PIPELINE_BIND_POINT_COMPUTE);
vkCmdDispatch(cmd, ...); // !!! debugPrintfEXT here does not output anything !!!
```
I tried the following things:
- Disable the extension and calls to `debugPrintfEXT` in the first compute shader: still no output
- Remove the first `vkCmdDispatch`: still no output
- Remove the `vkCmdBindDescriptorSet`: it works
- Swap the order of the two passes: debug outputs for both passes work
- Change the pipeline layout and shaders for the second pass to use the same descriptor set as the first pass: debug outputs for both passes work
- Change the pipeline layout and shaders for the second pass to use a different descriptor set and bind it with a second call of `vkCmdBindDescriptorSet` to the same slot: debug outputs for both passes work
- In all of the cases above: record a renderpass and graphics pipeline before the compute passes with the same or different descriptor set layouts: doesn't interfere with what happens to the compute passes
So to me it seems that the call to `vkCmdBindDescriptorSet` is the cause of the issue, as it binds the descriptor set to the compute bind point and there is no way to "unbind" it for the successive passes. If I understood the way `debugPrintfEXT` works correctly, the validation layer inserts another descriptor set for the message buffer. Maybe this actually unused descriptor set messes something up?
I did not have time to test whether the same issue occurs using successive render passes and graphics pipelines where some do not use any descriptor sets.
**Expected behavior**
`debugPrintfEXT` should also produce output for successive compute passes that do not use any descriptor sets.
**Valid Usage ID**
n/a
**Additional context**
n/a
Contributor guide
Assessment
This issue has not been assessed yet.