Repository navigation
Fixed #line issues with debug info and error messages - #2991
Merged
Adam Yang (adam-yang) merged 3 commits intoJun 22, 2020
Merged
Conversation
…#line messing with error messages.
Adam Yang (adam-yang)
requested review from
Gregory Roth (pow2clk) and
Tex Riddell (tex3d)
June 22, 2020 00:56
Gregory Roth (pow2clk)
left a comment
Collaborator
There was a problem hiding this comment.
Are there going to be any downsides to this? Will output for preprocessed shaders fail to correctly identify the original location?
Contributor
Author
Errors in preprocessed shaders will show the correct location as specified in the #line directive. |
Gregory Roth (pow2clk)
approved these changes
Jun 22, 2020
Gregory Roth (pow2clk)
left a comment
Collaborator
There was a problem hiding this comment.
Sounds good!
Contributor
Author
|
The error messages were actually not working before for preprocessed shaders, because the routines the error emitter uses to generate the source location actually expects a non-preprocessed location. |
Contributor
Author
|
Thanks for reviewing! |
Lssikkes
added a commit
to Lssikkes/DirectXShaderCompiler_NsightHLSLFix
that referenced
this pull request
Jul 13, 2022
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.
This change made the debug metadata store the original unprocessed source locations instead of the #line locations.
The debug metadata used to contain the #line locations, but since we use the source stored in the PDB instead of actual source files on disk, the debug info ended up mapping to non-existent files. Maybe when we could restore this old behaviour when debuggers support loading source files on disk.
This change also fixes error messages whenever there are #line directives. Since the error messages use the same mechanism to create location info as generating the debug info, they need the original unprocessed locations (rather than the #line locations).