-
Notifications
You must be signed in to change notification settings - Fork 263
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
HLSL sets __HLSL_VERSION
to invalid version
#6462
Comments
I think we should set the compiler to version 2021.
|
Defining it to 2021 is reasonable because slang’s semantics around these features is closer to HLSL 2021 than 2018. The only downside is that if there are existing code using this to decide if they can use templates, they will fail when compiled by the slang compiler. But they will get more salient compiler errors there, and it is better than having things silently compiles to a different semantic without noticing. |
Setting to 2021 is very much the wrong move. That is how users determine the ability to overload operators and use templates. Both of which are incompatible with Slang.
|
I think there isn't a perfect answer here. The ternary operator and logical short circuiting behavior is consistent with HLSL 2021, but given that this is already breaking our existing tests, setting to 2018 is likely the better answer. What we need to do though is when the user is specifying -language HLSL, we need to ensure to turn off short circuiting. But this can come at a later patch. For now I agree that we should set it to 2018, if this is mostly used to determine support for operator overload and templates. |
HLSL language versions are 2016, 2017, 2018, and 2021. Slang currently sets
__HLSL_VERSION
to 2020, which isn't a real HLSL language version:slang/source/slang/slang.cpp
Line 2369 in f7b9745
The text was updated successfully, but these errors were encountered: