cepl
cepl copied to clipboard
Try and avoid incompatible arg errors when defining pipelines with inline lamdbas
In the following code:
(defpipeline-g pline-0 ()
:vertex
(lambda-g ((vert g-pnt)
&uniform
(offset3 :vec3)
(color :vec4))
(let ((pos3 (pos vert)))
(values
(v! (+ pos3 offset3) 1)
color)))
:fragment
(lambda-g ((color :vec4))
color))
I added the second return from the vert stage & the color input to the frag stage at the same time, but because the macro expands to regular defun-g forms the vert stage recompiled first and complained that the second stage was not compatible.
I've get the feeling that we will need a special code path just to generate these pipelines if we want them to feel good
AH! we could emit define-vari-function instead of defun-g. This solves this and the other bug :)
of course then we need a way to compile vari functions, but it's a place to start :)