-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPIR-V] Typed Enum Implicit Conversions Fail #6884
Comments
The initial code generated by DXC looks correct: https://godbolt.org/z/onr1n3boP. The optimizer must be doing something wrong. |
My last comment is wrong. DXC is generating an incorrect instruction:
This should be an |
Yep, seems like this is the reason. Looking into it. |
An implicit cast from int enum to a float should be a Floating_Integral cast, not an Integral_Conversion. Fixes microsoft#6884 Signed-off-by: Nathan Gauër <[email protected]>
An implicit cast from int enum to a float should be a Floating_Integral cast, not an Integral_Conversion. Fixes microsoft#6884 Signed-off-by: Nathan Gauër <[email protected]>
Description
When using typed enums in math operations, they can completely fail to resolve to correct values. Casting the enum to its type in-place can resolve the issue.
Steps to Reproduce
enum : int { }
.0
.Actual Behavior
Shader playground minimal example of failure here.
compiles to
Instead of the expected
Shader playground minimal example of success here.
Environment
trunk
(I don't see one clearly on shader-playground, but we're targetingcs_6_6
, and are using 1.8 locally)The text was updated successfully, but these errors were encountered: