Skip to content
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

- (and maybe +) operators are missing legal type rules #185

Closed
psilord opened this issue Apr 3, 2018 · 4 comments
Closed

- (and maybe +) operators are missing legal type rules #185

psilord opened this issue Apr 3, 2018 · 4 comments

Comments

@psilord
Copy link

psilord commented Apr 3, 2018

Hello,

I noticed that the vari operator minus (-) failed to understand how to subtract a floating point
number from a vec3. This should be legal GLSL code.

So, please add this to vari:

(vari.glsl::v-def-glsl-template-fun - (a b) "(~a - ~a)"
	 (vari.types:v-vec3 vari.types:v-real) 0 :pure t)

;; and one for + too.
 (vari.glsl::v-def-glsl-template-fun + (a b) "(~a + ~a)"
	 (vari.types:v-vec3 vari.types:v-real) 0 :pure t)

Thank you!

@mfiano
Copy link

mfiano commented Apr 3, 2018

I can confirm there are a lot of template functions missing in this regard.

@cbaggers
Copy link
Owner

cbaggers commented Apr 3, 2018

@psilord thanks, you are correct. I've been meaning to get this into glsl-spec for a while now so I have opened a ticket over here. When they are added there I can remove all the definitions inside varjo and this will all be much more consistant.

@cbaggers
Copy link
Owner

cbaggers commented Apr 5, 2018

@psilord I added some more operator definitions to glsl-spec today. This takes care of this and other similar (unreported) issues.

I have not addressed type constructors yet as glsl-spec's goal is to have fully enumerated definitions and there are too many permutations of valid arguments for matrix constructors for this to be a valid approach. I'll open another issue for the type constructors.

Feel free to close this if the changes suit your needs :)

@cbaggers
Copy link
Owner

cbaggers commented Jul 1, 2018

Issues believed resolved. Matrix constructor issue being tracked here #209

@cbaggers cbaggers closed this as completed Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants