Handle the shader lambda-list (preamble)
This commit is contained in:
parent
c66e3c62e8
commit
a7fd8e4842
1 changed files with 9 additions and 3 deletions
|
|
@ -104,9 +104,15 @@ the forms comprised of these keywords will be printed in comments."
|
|||
first
|
||||
(walk-1 first)) (walk-list rest)))
|
||||
|
||||
(defun glsl-compile (lambda-list body)
|
||||
(declare (ignore lambda-list))
|
||||
(format nil "~%~a~%void main ()~%{~%~a}~%"
|
||||
(defun handle-preamble (form)
|
||||
"Handle a preamble declaration."
|
||||
(format nil "~@[layout (location = ~a) ~]~@[~(~a~) ~]~(~a~) ~(~a~) ~(~a~);~%"
|
||||
(awhen (member :location form) (cadr it))
|
||||
(awhen (member :interp form) (cadr it))
|
||||
(third form) (second form) (glsl-name (first form))))
|
||||
|
||||
(defun glsl-compile (lambda-list body)
|
||||
(format nil "~a~%~%~{~a~}~%void main ()~%{~%~a}~%"
|
||||
(mapcar #'handle-preamble lambda-list)
|
||||
(let ((*current-indent* 2))
|
||||
(walk `(progn ,body) *form-handlers* #'default-handler *env*))))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue