Initial support for NonSemantic.Shader.DebugInfo 101#4220
Open
dnovillo wants to merge 5 commits intoKhronosGroup:mainfrom
Open
Initial support for NonSemantic.Shader.DebugInfo 101#4220dnovillo wants to merge 5 commits intoKhronosGroup:mainfrom
dnovillo wants to merge 5 commits intoKhronosGroup:mainfrom
Conversation
Only emit version 101 import if the module requires NSDI 101.
Add a README section documenting where the canonical header lives and how to update it.
Collaborator
Author
|
For reference, these are the PRs adding NSDI.101 support:
|
| INSTANTIATE_TEST_SUITE_P( | ||
| Glsl, GlslNonSemanticShaderDebugInfoSpirv13Test, | ||
| ::testing::ValuesIn(std::vector<std::string>({ | ||
| "spv.debuginfo.coopmatKHR.comp", |
Contributor
There was a problem hiding this comment.
Can this test be removed?
Contributor
|
LGTM aside from Jeremy's comment. Before I merge, could you squash this into just two or three commits? One for the rename of the header file and associated enumeration values and the other one for the "initial implementation"? And the tests can go in their own commit or together with the implementation. |
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 implements NSDI.101 (KhronosGroup/SPIRV-Registry#390) in glslang. It updates SPIRV-Tools and SPIRV-Headers dependencies to bring in the new headers for NSDI.101.
Version promotion
To minimize disruption with existing tools, glslang will always generate an import of
NonSemantic.Shader.DebugInfo.100. If the module uses an opcode that requires NSDI.101 (cooperative types and new floating point types), it then changes the import string to.101. The promotion is done by patching theOpExtInstImportinstruction's string operand.The entry point is
Builder::requireNonSemanticShaderDebugInfoVersion. Each of the three new emitter functionscalls it unconditionally before emitting the instruction.
New emitters
Builder::makeVectorIdDebugType: emitsDebugTypeVectorIdEXT. Called frommakeCooperativeVectorTypeNVwhenemitNonSemanticShaderDebugInfois set.Builder::makeCooperativeMatrixDebugTypeKHR: emitsDebugTypeCooperativeMatrixKHR. Replaces the former opaque-composite workaround inmakeCooperativeMatrixTypeKHR.Builder::makeFloatDebugType: extended with an optionalfpEncodingoperand. The three float-8 and bfloat16 type builders (makeBFloat16Type,makeFloatE5M2Type,makeFloatE4M3Type) now handle the new floating point types.Header rename
This needed to import the new
NonSemanticShaderDebugInfo.hfrom SPIRV-Headers. This means that all the previous C identifiers that had100embedded in them needed to change. Those changes are mechanical, there is no functional change there.I also added a section in
README.mdto document how to update this headers in future revisions of NSDI.Tests
I replaced the previous golden output tests
spv.debuginfo.coopmatKHR.compwith a new unit test filegtests/SpvDebugInfoTest.cpp. All the NSDI.101 opcodes are tested there.