-
Notifications
You must be signed in to change notification settings - Fork 187
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
Matrix-float multiplication cross-compilation fails #103
Comments
Can you copy-paste in the error message you see? My guess is that I'm just missing some overloads of |
One more note-to-self issue here is that I'm realizing there could be subtle problems if cross-compilation involves scalar-to-matrix conversion. There is a similar issue where I need to make sure to translate HLSL |
I think I misunderstood this error. The problem is not that we are giving an error on a matrix-scalar multiply in GLSL code, but rather that we are giving the error on Slang code that tries to do matrix-times-scalar. It seems like this error shouldn't be specific to cross-compilation, then, and should occur for any Slang code that tries to do this. |
Yep. I can repro this is a bare Slang file, so this is just a plain old screw-up on my part. There are two reasonable ways to fix this:
It isn't clear to me which is the way that HLSL interprets this kind of things internally. |
Fixes shader-slang#103 - Previously I was relying on scalar-to-vector promotion to pick the right type in these cases, but I hadn't implemented scalar-to-matrix promotion (I should...) - Rather than relying on promotion behavior, this change goes ahead and adds explicit overloads. I think this is probably a better decision in the long term, since one might want to support these cases for operators, while warning (or erroring) on the more general cases of implicit conversion. - This covers matrix/scalar, scalar/matrix, vector/scalar, and scalar/vector cases
Looks like it's a Slang bug, since the GLSL compiler is never invoked.
We are using it for vertex-blending-
ShaderCommon.slang::59
-getBlendedWorldMat
The text was updated successfully, but these errors were encountered: