summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/graphics/shader.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/chickadee/graphics/shader.scm b/chickadee/graphics/shader.scm
index d1ba7ce..5af2c7e 100644
--- a/chickadee/graphics/shader.scm
+++ b/chickadee/graphics/shader.scm
@@ -435,6 +435,10 @@
(size uniform-size)
(value uniform-value %set-uniform-value!))
+(define (sampler? uniform)
+ (or (eq? (uniform-type uniform) sampler-2d)
+ (eq? (uniform-type uniform) sampler-cube)))
+
;; variable name -> {uniform, namespace, uniform array} map
(define-record-type <uniform-namespace>
(make-uniform-namespace name members)
@@ -839,8 +843,7 @@ shader program."
;; most other values. In the case of samplers, they are
;; mapped to OpenGL's "texture units", so we need to
;; ignore them here.
- (unless (or (eq? (uniform-type uniform) sampler-2d)
- (eq? (uniform-type uniform) sampler-cube))
+ (unless (sampler? uniform)
(traverse uniform (shader-struct-ref value key))))
uniform)
(error "expected shader struct" x)))