Add NonSemantic.Shader.DebugInfo.100 options for Nvidia Nsight and/or RenderDoc source debugging - #1589
Open
DannyArends wants to merge 2 commits into
Open
Add NonSemantic.Shader.DebugInfo.100 options for Nvidia Nsight and/or RenderDoc source debugging#1589DannyArends wants to merge 2 commits into
DannyArends wants to merge 2 commits into
Conversation
Add generate_nonsemantic_debug_info_ / _source_ to libshaderc_util's Compiler, wired to glslang SpvOptions::emitNonSemanticShaderDebugInfo and emitNonSemanticShaderDebugSource (equivalent to glslang -gV/-gVS). Kept independent from generate_debug_info_ so plain -g stays available as a fallback for shaders that fail to compile with NonSemantic info. Enables function- and call-site-level source correlation in Nsight Graphics (Flame Graph, Top-Down/Bottom-Up Calls), which the existing -g-only path does not provide. Extract the strip-pass unqueue loop into UnstripDebugInfoPasses() and guard SetOptimizationLevel against stripping when either debug mode is on.
Wire SetGenerateNonSemanticDebugInfo / SetGenerateNonSemanticDebugSource
from libshaderc_util::Compiler up through the public API:
shaderc_compile_options_set_generate_nonsemantic_debug_{info,source} in
the C API, plus the matching CompileOptions methods in shaderc.hpp.
Mirrors the existing set_generate_debug_info plumbing. Lets callers
request glslang -gV/-gVS output (NonSemantic.Shader.DebugInfo.100) for
Nsight Graphics call-site correlation without dropping to internal headers.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
Update: I have signed the CLA, let me know if anything else is needed from my side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two compile options that make shaderc emit NonSemantic.Shader.DebugInfo.100, equivalent to glslang's -gV / -gVS:
Additionally, I have wired up matching CompileOptions::SetGenerateNonSemanticDebugInfo() / SetGenerateNonSemanticDebugSource() in the C++ wrapper.
Why
set_generate_debug_info only emits OpLine/OpSource (glslang -g). Tools like NVIDIA Nsight Graphics need NonSemantic.Shader.DebugInfo.100 for function- and call-site-level source correlation (Flame Graph, Top-Down/Bottom-Up Calls). shaderc had no way to request it (see #1391), so callers had to drop to glslang or dxc directly. The pull requests makes these new flag independent from generate_debug_info so plain -g stays available as a fallback for shaders that fail to compile withNonSemantic info enabled.
Usage: a Nsight-ready build
-g provides the line table, -gVS provides the call graph; Nsight uses both. Optimization must stay at zero. The size/performance passes can mangle or strip NonSemantic info even with the strip-guards in place.
Notes