Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vulkan: push constants are seemingly not captured when debugging vert/frag shaders #3189

Closed
AlexRouSg opened this issue Dec 22, 2023 · 4 comments
Labels
Bug A crash, misbehaviour, or other problem Need More Info More information is needed from a user to work on this issue

Comments

@AlexRouSg
Copy link

Description

I am trying to debug a fragment shader in renderdoc and apparently push constants are zeroed out in the shader debugger even tho they are correctly filled when looking at the pipeline state.

Steps to reproduce

  • use vulkan
  • have graphics piepline drawing anything (I am using dynamic rendering but don't think that matters)
  • have push constants in vert/frag shader
  • select random pixel in texture viewer when vkCmdDraw is selected
  • debug pixel
  • inspect value of push constants

I am willing to provide RDC files though email on request.

Environment

  • RenderDoc version: v1.30 - 4 Dec, 2023
  • Operating System: Windows 10
  • Graphics API: Vulkan 1.3
  • Device: NVIDIA GTX 1080 ti with 546.33
@baldurk
Copy link
Owner

baldurk commented Dec 22, 2023

Yes you should definitely share the capture because that is the most critical part of your reproduction steps. The case of shader debugging using push constants is tested nightly as part of RenderDoc's autotests and works correctly. Without the capture none of the other steps you've listed mean anything as they are very generic and apply to almost any scenario, and this is not so generally and widely broken. If you have a capture you can share I'm not sure why you wouldn't share that immediately.

I would also recommend that you run your program with the vulkan validation layers, as errors in your application may cause RenderDoc to misbehave as it does not handle invalid API use.

@baldurk baldurk added Bug A crash, misbehaviour, or other problem Need More Info More information is needed from a user to work on this issue labels Dec 22, 2023
@AlexRouSg
Copy link
Author

AlexRouSg commented Dec 22, 2023

email has been sent, thank you for your time,
I would note that there is 0 validation errors even with sync validation turned on

@baldurk
Copy link
Owner

baldurk commented Dec 22, 2023

Your application contains invalid use of Vulkan which causes this behaviour.

In particular you use two different pipeline layouts for the pre-rasterization shaders and fragment shaders libraries, and they do not define identical push constants, which violates VUID-VkGraphicsPipelineCreateInfo-flags-06621:

If one element of VkPipelineLibraryCreateInfoKHR::pLibraries includes VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT and another element includes VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, push constants specified in layout in both this pipeline and the library which are available to shader stages in each must be identically defined.

VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT only applies to descriptor sets, as the name implies, push constant ranges must still be identically defined in all pipeline layouts used.

If you are not seeing an error from the validation layers on this I would first make sure you have them enabled correctly, and if you do then file an issue with the validation layers to ensure they are aware that this check is missing.

@baldurk baldurk closed this as completed Dec 22, 2023
@AlexRouSg
Copy link
Author

I have confirmed that this is indeed what caused the weird behaviour, sorry for the noise and thank you for your hard work on renderdoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A crash, misbehaviour, or other problem Need More Info More information is needed from a user to work on this issue
Projects
None yet
Development

No branches or pull requests

2 participants