Commit Graph

12 Commits

Author SHA1 Message Date
Qingyuan Zheng
a496a34b43 Sanitize debug source location tracking for implicit branch and return
This patch tries to attach debug location of a branch/return instruction to its predecessor or the closing brace. If none could be found, no debug info should be emitted.
2024-09-02 14:20:19 -04:00
Steven Perron
33c7e30860
Don't emit duplicate decorations. (#3635)
It is invalid if the same decoration is applied to the same id multiple
times. This adds a check before adding a decoration that the decoration
is not already in the list. If it is, then the duplicate is not added.

Fixes #3627
2024-06-28 19:16:59 -04:00
Jeremy Hayes
bf08e1db5c Fix debug info file and source strings
The file and source text was not being set correctly in the test output.
This change makes the test fixture consistent with the command line
behavior, "-gVS", which was my original intent when I added these tests.
2024-03-01 18:08:54 -05:00
Qingyuan Zheng
30661abd9c
Clean up the debug line info tracking and generation.
- Correctly populate the field `currentFileId` with the presence of include directive
- Support lazy OpLine/OpDebugLine generation only when a real instruction is added instead of a debug location is set
- Improve the debug location tracking to per-block instead of just per-builder
- A few bug fixes related to debug source info
2024-02-09 10:27:40 -08:00
Sajjad Mirza
e17ecb0e80
Emit DebugTypePointer when non-semantic debug info is enabled 2023-12-28 11:00:37 -05:00
Chao Chen
979423d84f Add correct line number to OpDebugFunction and OpDebugScope for function:
1. Pull OpDebugFunction, OpDebugScope and OpDebugVariable for params out
   of makeFunctionEntry.
2. Put above in a separate function called setupDebugFunctionEntry,
   which also accept line number and set it correctly in builder.
3. Call setupDebugFunctionEntry in makeFunction. Also special case
   handle entry function since it's created ealier elsewhere.
2023-10-24 13:37:19 -07:00
Sajjad Mirza
afe6e781bd
Emit correct nonsemantic debug info for explicitly sized types
Previously, the type names in the nonsemantic shader debug info would be
"int", "uint", or "float" for all numeric types. This change makes the
correct names such as "int8_t" or "float16_t" get emitted.
2023-09-11 20:11:22 -04:00
Arcady Goldmints-Orlov
d89c0b1d13 Force generateDebugInfo when non-semantic debug info is enabled
From the command line, the debug options "stack", with -gVS enabling all
of generateDebugInfo, emitNonSemanticShaderDebugInfo and
emitNonSemanticShaderDebugSource, however the programmatic interface
allows setting the latter options without the former. In this case, the
string corresponding to the source filename never gets emitted and some
debuginfo instructions end up with zero ID operands, resulting in
invalid SPIR-V.

Fixes #3240
2023-06-27 13:49:14 -04:00
Jeremy Hayes
d38d06c03f Fix debuginfo disassembly 2022-12-22 15:43:03 -07:00
Jeremy Hayes
78221d619e Update CHANGES for release 11.12.0 2022-10-13 10:58:53 -06:00
Jeremy Hayes
ee442785dd Use DebugDeclare for local variables
Previously we had decided to issue DebugValue directly in glslang.
However, this was incorrect and causing issues with RenderDoc.
2022-09-23 09:33:50 -06:00
Jeremy Hayes
7a914ce926 Implement NonSemantic.Shader.DebugInfo.100
See https://github.com/KhronosGroup/SPIRV-Registry.
2022-08-26 16:17:54 -06:00