Skip to content

[spirv] Translate HLSL min/max to NMin/NMax#4517

Merged
sudonatalie merged 1 commit intomicrosoft:mainfrom
sudonatalie:issue-3221
Jun 17, 2022
Merged

[spirv] Translate HLSL min/max to NMin/NMax#4517
sudonatalie merged 1 commit intomicrosoft:mainfrom
sudonatalie:issue-3221

Conversation

@sudonatalie
Copy link
Copy Markdown
Collaborator

The specification for the HLSL min and max intrinsic functions states
that if one of the values is NaN, the other will be given as the result,
which is correctly represented by the GLSL.std.450 instructions NMin and
NMax, respectively. By the semantics of the previously used FMin and
FMax instructions, this would be undefined behavior.

Fixes #3221

The specification for the HLSL min and max intrinsic functions states
that if one of the values is NaN, the other will be given as the result,
which is correctly represented by the GLSL.std.450 instructions NMin and
NMax, respectively. By the semantics of the previously used FMin and
FMax instructions, this would be undefined behavior.

Fixes microsoft#3221
@sudonatalie sudonatalie requested a review from kuhar June 17, 2022 18:51
Copy link
Copy Markdown
Collaborator

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AppVeyorBot
Copy link
Copy Markdown

@sudonatalie sudonatalie merged commit 2a0833a into microsoft:main Jun 17, 2022
@sudonatalie sudonatalie deleted the issue-3221 branch June 17, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SPIR-V] FMin/FMax/FClamp NaN handling contradicts HLSL specification

3 participants