Repository navigation
[SPIR-V] Fix invalid isnan codegen - #6754
Merged
Merged
Conversation
IsNan returns a boolean, even is the input-type is a float. This was working in most cases except: - if the layout was not Void - if the input type was not a matrix The first bug is because a bool memory layout/representation is not specified, and shall never be exposed to externaly-accessible memory. Hence, if we saw a layout rule != Void, we converted it to a UINT. When calling isnan, the layout rule should not be propagated as we loose any layout info. The second is because our codegen assumed matrix operations returned a matrix with the same type as the input parameters. In the case of isnan, this was just wrong. Fixes microsoft#6712 Signed-off-by: Nathan Gauër <[email protected]>
Nathan Gauër (Keenuts)
requested review from
Cassandra Beckley (cassiebeckley) and
Steven Perron (s-perron)
July 9, 2024 13:40
Steven Perron (s-perron)
approved these changes
Jul 15, 2024
Steven Perron (s-perron)
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. We will need to follow up with other similar bugs.
Collaborator
Author
|
Cassandra Beckley (@cassiebeckley) in case you missed it. |
Natalie Chouinard (sudonatalie)
approved these changes
Jul 19, 2024
Natalie Chouinard (sudonatalie)
left a comment
Collaborator
There was a problem hiding this comment.
LGTM!
Mxr (SjMxr233)
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
IsNan returns a boolean, even is the input-type is a float. This was working in most cases except: - if the layout was not Void - if the input type was not a matrix The first bug is because a bool memory layout/representation is not specified, and shall never be exposed to externaly-accessible memory. Hence, if we saw a layout rule != Void, we converted it to a UINT. When calling isnan, the layout rule should not be propagated as we loose any layout info. The second is because our codegen assumed matrix operations returned a matrix with the same type as the input parameters. In the case of isnan, this was just wrong. Fixes microsoft#6712 Signed-off-by: Nathan Gauër <[email protected]>
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.
IsNan returns a boolean, even is the input-type is a float. This was working in most cases except:
The first bug is because a bool memory layout/representation is not specified, and shall never be exposed to externaly-accessible memory. Hence, if we saw a layout rule != Void, we converted it to a UINT. When calling isnan, the layout rule should not be propagated as we loose any layout info.
The second is because our codegen assumed matrix operations returned a matrix with the same type as the input parameters. In the case of isnan, this was just wrong.
Fixes #6712