cbaggers / varjo

Lisp to GLSL Language Translator
BSD 2-Clause "Simplified" License
223 stars 23 forks source link

incf of vector component complains that user is trying to assign an int to a float place #229

Closed cbaggers closed 5 years ago

cbaggers commented 5 years ago

here is some example code

VARI> (varjo:glsl-code 
       (varjo:translate
    (varjo:create-stage 
     :fragment :450
     :code '((let* ((v (v! 1 2 3 4)))
           (incf (x v))
           v)))))

and the error

Varjo: Currently varjo cannot handle changing the type through an assignment due
to the static nature of glsl.
place: FLOAT
value: INT
Problematic form: (INCF (X V) 1)

It works if the form is (incf (x v) 1f0) so this must be a bug in how places are handled as (+ (x v) 1) naturally promotes to float

cbaggers commented 5 years ago

Fixed in bcc183c