Skip to content

Conversation

@Keenuts
Copy link
Collaborator

@Keenuts Keenuts commented Oct 30, 2024

When an a chain of casts were performed in an initializer list, only the source and destination types were considered. This means float -> uint was the same as float -> int -> uint. This however is not correct: intermediate casts can change the result.

Removing the shortcut we took solves this issue.

Fixes #6975

When an a chain of casts were performed in an initializer list,
only the source and destination types were considered.
This means float -> uint was the same as float -> int -> uint.
This however is not correct: intermediate casts can change the result.

Removing the shortcut we took solves this issue.

Fixes microsoft#6975

Signed-off-by: Nathan Gauër <[email protected]>
@Keenuts Keenuts requested a review from a team as a code owner October 30, 2024 13:38
@s-perron s-perron merged commit ac36a79 into microsoft:main Nov 1, 2024
13 checks passed
SjMxr233 pushed a commit to ShaderHelper/DirectXShaderCompiler that referenced this pull request Jul 24, 2025
When an a chain of casts were performed in an initializer list, only the
source and destination types were considered. This means float -> uint
was the same as float -> int -> uint. This however is not correct:
intermediate casts can change the result.

Removing the shortcut we took solves this issue.

Fixes microsoft#6975

Signed-off-by: Nathan Gauër <[email protected]>
@Keenuts Keenuts deleted the fix-6975 branch September 9, 2025 15:11
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] Incorrect float->int->uint conversion behavior

3 participants