This repository was archived by the owner on Dec 29, 2022. It is now read-only.
[spirv] fix DebugTypeArray bug#312
Merged
jaebaek merged 4 commits intogoogle:debug_infofrom Jun 5, 2020
Merged
Conversation
Author
|
Ben found this bug by compiling the Sascha-William skeletal animation shader. |
|
❌ Build DirectXShaderCompiler 1.0.427 failed (commit 3893cf4e51 by @jaebaek) |
The pseudo code for lowering an array type in DebugTypeVisitor is ``` elementType = arrayType->element if elementType is an array type (DebugTypeArray for elementType).appendOneMoreDimensionAtTheEnd(count) else new DebugTypeArray(lower(arrayType->element), count) ``` When it appends one more dimension at the end of previously created DebugTypeArray, it reuses the existing DebugTypeArray object, which result in a wrong DebugTypeArray for a previously shown array type. For example, ``` float foo[2]; --> dbg_type_array = DebugTypeArray(float, 2) float bar[2][3]; --> dbg_type_array.appendOneMoreDimensionAtTheEnd(3) // When emitting the SPIRV, dbg_type_array is // DebugTypeArray(float, 2, 3) which is incorrect for "foo" ``` This commit lets DebugTypeVisitor create a new DebugTypeArray object for new array type to fix this bug.
|
❌ Build DirectXShaderCompiler 1.0.433 failed (commit 450aeb0810 by @jaebaek) |
|
✅ Build DirectXShaderCompiler 1.0.436 completed (commit 32d8ef8d43 by @jaebaek) |
ehsannas
suggested changes
Jun 5, 2020
jaebaek
commented
Jun 5, 2020
Author
jaebaek
left a comment
There was a problem hiding this comment.
Thank you for your code review. PTAL!
ehsannas
approved these changes
Jun 5, 2020
ehsannas
approved these changes
Jun 5, 2020
|
✅ Build DirectXShaderCompiler 1.0.438 completed (commit 11cf77e17b by @jaebaek) |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The pseudo code for lowering an array type in DebugTypeVisitor is
When it appends one more dimension at the end of previously created
DebugTypeArray, it reuses the existing DebugTypeArray object, which
result in a wrong DebugTypeArray for a previously shown array type.
For example,
This commit lets DebugTypeVisitor create a new DebugTypeArray object for
new array type to fix this bug.