diff options
Diffstat (limited to 'chickadee/render.scm')
-rw-r--r-- | chickadee/render.scm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chickadee/render.scm b/chickadee/render.scm index b898cb5..edf21f7 100644 --- a/chickadee/render.scm +++ b/chickadee/render.scm @@ -133,10 +133,10 @@ (syntax-case x () ((_ shader ()) (datum->syntax x #t)) ((_ shader (name value . rest)) - (with-syntax ((sname (datum->syntax x (keyword->string + (with-syntax ((sname (datum->syntax x (keyword->symbol (syntax->datum #'name))))) #'(begin - (shader-uniform-set! shader sname value) + (shader-uniform-set! shader 'sname value) (uniform-apply shader rest))))))) (define-syntax-rule (gpu-prepare shader vertex-array uniforms) @@ -157,10 +157,11 @@ ;; Sampler2D values aren't explicitly passed as uniform values via ;; gpu-apply, so we have to set their values correctly behind the ;; scenes. - (hash-for-each (lambda (name uniform) - (when (eq? 'sampler-2d (uniform-type uniform)) - (shader-uniform-set! shader (uniform-name uniform) (uniform-value uniform)))) - (shader-uniforms shader)))) + (uniform-namespace-for-each + (lambda (name uniform) + (when (and (uniform? uniform) (eq? 'sampler-2d (uniform-type uniform))) + (shader-uniform-set! shader (uniform-name uniform) (uniform-value uniform)))) + (shader-uniforms shader)))) (define-syntax-rule (gpu-apply* shader vertex-array count . uniforms) (begin |