Christian Buttner
Christian Buttner
Thanks. I think the implicit scalar broadcast cast should be explicit instead. This should better signify intent to actually do a broadcast, and prevent accidentally assigning or passing a scalar...
It should break this, scaling is the only operator that makes sense mathematically ("ah yes, let me add 1 to a vector"). I'd rather it be `x + (int[])1`.
True, but it's important to note that for GLSL the implicit cast is only legal for operators, meaning you can't assign or pass a scalar to a vector (see https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf...
I'm still on the fence about this, except for one thing that bothers me the most. I found a solution that works for me though: I added a specific check...
The original issue looks fixed. As for the changes to implicit scalar->vector casting, I feel pretty good about them. They strike a good middle ground between convenience and explicitness.
The size and layout of the struct was not wrong in my example. It was the array offset specifically.
Why can that happen, why isn't the struct size used directly? Also your test doesn't check for the array case.
Thanks for the explanation, that makes sense to me. The issue looks fixed in my codebase too.
@kcvinker You can use `@export` on your types to name them correctly.