-
Notifications
You must be signed in to change notification settings - Fork 22
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
Many valid matrix constructors missing #209
Comments
We are also missing the ability to do things like the following:
And the reason is a limitation in varjo/glsl-spec. I am trying, over time, to remove ugly hacks that exist in varjo. One significant one is that, for some functions (which are not special forms) the return typed is computed rather than just looked up from the spec. These functions suck as they bloat the codebase with extra rules/hacks and they cant be defined in glsl-spec, In the case of the matrix constructor rules above, the number of valid permutations of argument types is huge (more than all the function overloads in the rest of the glsl spec combined iirc) so as it stands we cannot (sensibly) add all the constructors to glsl-spec. I've been looking into supporting some kind of trait system, but regardless of the approach, without some support for polymorphism we would either have to:
Come to think of it, even with a traditional generics (ala c#) or traits system I think the permutation problem could still exist. Egh Maybe the return type hack is the only way..what a bummer |
The sized & single value constructors should be easy though. I also can forsee any problems with the conversions. I'll get on these soon |
Actually size matrix types will be interesting as in varjo they are totally independent types, I have operators defined for them but mat2 is not equivalent to mat2x2. A function defined for mat3 will not take a mat3x3. This may be fine but needs looking into |
Making some progress cbaggers/glsl-spec@cb63e00 Will cover #206 at least. I'll look at non square matrices now |
And now #205 too. Going to look at some other issues and then test this stuff before merging into master |
This issue is to combine the previous separate, valid issues raised by @mfiano and also to add my own issue to the pile
#207
#206
#205
Missing sized constructors
We need to add mat2x2, mat2x3, mat2x4, mat3x2, mat3x3, mat3x4, mat4x2, mat4x3, mat4x4
Matrices cannot be constructed from a single scalar
Matrices cannot be converted to other matrices
The text was updated successfully, but these errors were encountered: