-
Notifications
You must be signed in to change notification settings - Fork 219
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
Added SpvOptions::generateDebugInfo support to ShaderCompileSettings. #748
Conversation
It's too bad that both our solutions require changes to / cooperation from the client application. Dare I suggest an environment variable that would enable shader source code debugging? |
On Sat, 11 Mar 2023 at 22:46, Tim Moore ***@***.***> wrote:
It's too bad that both our solutions require changes to / cooperation from
the client application. Dare I suggest an environment variable that would
enable shader source code debugging?
The issue of 3rd parties snooping in a company's application shaders is an
issue we'd need to resolve if we did something like this. Perhaps compile
in the option for enabling /disabilingit via cmake.
I have been wondering whether linking it into the WindowTraints::debugLayer
might be appropriate, though that's currently quite disconnected from
building scene graphs etc.
First thing first though, we just nee dto merge the feature as is, then we
can ponder on further refinements.
Robert.
… Message ID: ***@***.***>
|
Other possibilities:
|
@timoore I will merge this morning after I've done some more thinking about enabling it cleanly. Any more ideas? I am currently wondering if a utility function might be useful for enabling it on the built-in ShaderSet i.e. set up vsg::Options with custom ShaderSet with the defaultShaderHints set to generateDebugInfo. Don't have any ideas that have popped into my head that are the obvious way to do it. |
I've added a enableGenerateDebugInfo(..) function to vsgviewer and if I use it and use the Vulkan debug layer I get:
UNASSIGNED-CoreValidation-Shader-FeatureNotEnabled(ERROR / SPEC): msgNum: -1940616195 - Validation Error: [ UNASSIGNED-CoreValidation-Shader-FeatureNotEnabled ] Object 0: handle = 0x56404e4375e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x8c548bfd | Shader requires extension VK_KHR_shader_non_semantic_info but is not enabled on the device Have you seen this? I haven't checked in my changes to vsgviewer, first I'll look into the above debug error. |
I do see this when running vsgCs' worldviewer standalone i.e., not under RenderDoc. I think the Vulkan layer installed by RenderDoc must provide the extension. Do you think it's worthwhile to check for the extension before enabling the feature? |
I like the idea of a global setting in the ShaderCompiler that is enabled by a VSG option. Turning it on in debug builds would work too. I don't see much interest in enabling / disabling the feature on a per-ShaderSet basis. I'm sympathetic to your concerns about third party IP and see why an environment variable might not be a good idea, but I don't want to bend over backwards to make the shader source hard to get at, to the detriment of debuggability. Until now I've been dependent on RenderDoc shader debugging with its disassembly, which is not too different from debugging C++ in ReleaseWithDebugInfo mode. This source level debugging is a nice improvement, not vital, but also not revealing a lot more shader implementation than you can already see with RenderDoc. |
…s older than 135.
I have added fallback for the VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME for older Vulkan verrsions: 38f669f. I have also checked in the enabling of the generateDebugInfo for the built in ShaderSet in vsgviewer: Enabling the generateDebugInfo is still limited to explicitly enabling it, but it's hard to just do it enable it automatically for all usage cases as precompile SPRIV shaders can't be redone. I think it's worth just merging this branch and the change to vsgviewer to get the ball rolling, then later we can add further support when we come up with clean way of doing it. |
@timoore I have just installed renderdoc from the ubuntu repo but it crashes when I start the application.... So I'm now pulling down the source code and will see how I get on. Which renderdoc version are you using? |
I downloaded RenderDoc 1.25 binaries from https://renderdoc.org/ . I believe that 1.25 is required for shader source debugging. |
I have renderdoc working now, it's a while since I used it so I'll have to relearn how to use it properly.... |
This didn't make it in vsg-dev#748
No description provided.