cepl icon indicating copy to clipboard operation
cepl copied to clipboard

Try and avoid incompatible arg errors when defining pipelines with inline lamdbas

Open cbaggers opened this issue 7 years ago • 2 comments

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

cbaggers avatar Apr 22 '18 15:04 cbaggers

AH! we could emit define-vari-function instead of defun-g. This solves this and the other bug :)

cbaggers avatar Apr 22 '18 17:04 cbaggers

of course then we need a way to compile vari functions, but it's a place to start :)

cbaggers avatar Apr 22 '18 17:04 cbaggers