-
Notifications
You must be signed in to change notification settings - Fork 248
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
Use and() and or() functions for logical-AND and OR #6310
Use and() and or() functions for logical-AND and OR #6310
Conversation
With this commit, Slang will emit function calls to `and()` and `or()` for the logical-AND and logical-OR when the operands are non-scalar and the target profile is SM6.0 and above. This is required change from SM6.0. For WGSL, there is no operator overloadings of `&&` and `||` when the operands are non-scalar. Unlike HLSL, WGSL also don't have `and()` nor `or()`. Alternatively, we can use `select()`.
4324aaf
to
2612c2a
Compare
It looks like my change is failing on a few Falcor image tests. |
The failure on Falcor is due to the outdated DX validator. With my change, the following code causes the validation to fail:
Before my change, it was:
Note that the following passes the validation, so the problem is on the type given to
|
I think we want to make sure we convert the operands of |
I am working on this to handle the type properly. When I changed the test case little bit to cover the case, I started to see SPIRV validation failure too. We have |
I am fixing the Metal case. |
Yeah¡ CI all green |
With this commit, Slang will emit function calls to
and()
andor()
for the logical-AND and logical-OR when the operands are non-scalar and the target profile is SM6.0 and above. This is required change from SM6.0.For WGSL, there is no operator overloadings of
&&
and||
when the operands are non-scalar. Unlike HLSL, WGSL also don't haveand()
noror()
. Alternatively, we can useselect()
.Closes #6307