Skip to content

[SPIR-V] Fix InterlockedMin/Max codegen#6609

Merged
sudonatalie merged 1 commit intomicrosoft:mainfrom
sudonatalie:issue-3196
May 14, 2024
Merged

[SPIR-V] Fix InterlockedMin/Max codegen#6609
sudonatalie merged 1 commit intomicrosoft:mainfrom
sudonatalie:issue-3196

Conversation

@sudonatalie
Copy link
Copy Markdown
Collaborator

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

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
@sudonatalie sudonatalie requested a review from Keenuts May 10, 2024 19:30
@sudonatalie sudonatalie requested a review from a team as a code owner May 10, 2024 19:30
@sudonatalie sudonatalie enabled auto-merge (squash) May 14, 2024 17:22
@sudonatalie sudonatalie merged commit 4273354 into microsoft:main May 14, 2024
@sudonatalie sudonatalie deleted the issue-3196 branch May 14, 2024 17:30
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[SPIR-V] Signed integer min/max atomics generate invalid SPIR-V

3 participants