[WIP] Debug info entry as local #8069
Draft
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.
DO NOT REVIEW
WIP
The intention
This commit is to reconstruct the entry-point parameters as local variables.
And then, we will be able to provide the debug information to the shader debuggers easily.
Consider the pre-existing test,
tests/spirv/debug-variable-scope.slang
,Currently the following command removes the entry point variable and each member is inlined to where they are used.
This commit is to reconstruct the entry-point parameter as a local variable so that we can provide Debug info for the entry point parameter,
When the entry-point parameter is an array of struct
One thing to note is that when the entry point is an array of struct,
tests/cross-compile/geometry-shader.slang
,Currently it generates the following,
This commit will change it to the following,
The tricky part is that the system build-in variables are in a form of array for each semantic.
And the user expect to get the debug information in a form of "array-of-struct".
The implementation maps each member variable to its corresponding global variable with
DebugValue
.