Skip to content

[SPIRV] Generate OpSource for All Includes - #6094

Merged
Steven Perron (s-perron) merged 1 commit into
microsoft:mainfrom
SteveUrquhart:generate-opsource-for-all-includes
Jan 15, 2024
Merged

Steven Perron (s-perron) merged 1 commit into
microsoft:mainfrom
SteveUrquhart:generate-opsource-for-all-includes

Conversation

@SteveUrquhart

Copy link
Copy Markdown
Contributor

The current implementation generates SPIR-V OpSource instructions from within EmitVisitor::emitDebugLine(), part of OpLine processing, improperly tying the two together. Only files including instructions that generate an OpLine will generate an OpSource, meaning that many include files are missed. An included file may include nothing more than preprocessor macro definitions, but that should still generate an OpSource.

The SourceManager already tracks the correct and complete list of files generated by the preprocessor in LineTable. We therefore propose a new pair of SourceManager api's that expose the LineTable. SpirvEmitter::HandleTranslationUnit() may now simply and directly create all required OpSource instructions.

@s-perron
Steven Perron (s-perron) merged commit 2f00209 into microsoft:main Jan 15, 2024
Steven Perron (s-perron) pushed a commit that referenced this pull request Sep 26, 2024
Previously, we fixed the SPIRV OpenCL debug info to always represent all
include files, even those that only have preprocessor definitions. This
work was merged in
#6094. This PR
applies the same fix to the NonSemantic debug info, and resolves
#6907
Mxr (SjMxr233) pushed a commit to ShaderHelper/DirectXShaderCompiler that referenced this pull request Jul 24, 2025
Previously, we fixed the SPIRV OpenCL debug info to always represent all
include files, even those that only have preprocessor definitions. This
work was merged in
microsoft#6094. This PR
applies the same fix to the NonSemantic debug info, and resolves
microsoft#6907
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants