[SPIR-V] Fix InterlockedMin/Max codegen#6609
Merged
sudonatalie merged 1 commit intomicrosoft:mainfrom May 14, 2024
Merged
Conversation
RWByteAddressBuffer has overloads for InterlockedMin and InterlockedMax for signed ints that were failing to compile due to mismatched types in the generated SPIR-V instruction. This adds the missing cast if necessary. At the same time, some redundant code is removed from the InterlockedMin/Max intrinsic non-member functions' codegen to modify the opcode. If it was necessary in the past, the frontend has since been fixed and it is no longer necessary. Tests to verify these combinations and the necessary implicit casts have also been added. Fixes microsoft#3196 Related to microsoft#4189, microsoft#6254, microsoft#5707
Keenuts
approved these changes
May 13, 2024
dnovillo
approved these changes
May 14, 2024
SjMxr233
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
RWByteAddressBuffer has overloads for InterlockedMin and InterlockedMax for signed ints that were failing to compile due to mismatched types in the generated SPIR-V instruction. This adds the missing cast if necessary. At the same time, some redundant code is removed from the InterlockedMin/Max intrinsic non-member functions' codegen to modify the opcode. If it was necessary in the past, the frontend has since been fixed and it is no longer necessary. Tests to verify these combinations and the necessary implicit casts have also been added. Fixes microsoft#3196 Related to microsoft#4189, microsoft#6254, microsoft#5707
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.
RWByteAddressBuffer has overloads for InterlockedMin and InterlockedMax for signed ints that were failing to compile due to mismatched types in the generated SPIR-V instruction. This adds the missing cast if necessary.
At the same time, some redundant code is removed from the InterlockedMin/Max intrinsic non-member functions' codegen to modify the opcode. If it was necessary in the past, the frontend has since been fixed and it is no longer necessary. Tests to verify these combinations and the necessary implicit casts have also been added.
Fixes #3196
Related to #4189, #6254, #5707