summaryrefslogtreecommitdiff
path: root/chickadee/graphics/shader.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chickadee/graphics/shader.scm')
-rw-r--r--chickadee/graphics/shader.scm15
1 files changed, 7 insertions, 8 deletions
diff --git a/chickadee/graphics/shader.scm b/chickadee/graphics/shader.scm
index 3d8d369..ab0a8cf 100644
--- a/chickadee/graphics/shader.scm
+++ b/chickadee/graphics/shader.scm
@@ -197,14 +197,13 @@
#:size 16 ; 16 bytes = 4 floats = 1 vec4
#:validator (lambda (x) (or (rect? x) (color? x)))
#:serializer
- (let ((unwrap-rect (@@ (chickadee math rect) unwrap-rect)))
- (lambda (bv i x)
- ;; As of now, there is no vec4 Scheme type, but we do want to
- ;; accept colors and rects as vec4s since there is no special
- ;; color or rect type in GLSL.
- (if (rect? x)
- (bytevector-copy! (unwrap-rect x) 0 bv i 16)
- (bytestruct-pack! <color> ((() x)) bv i))))
+ (lambda (bv i x)
+ ;; As of now, there is no vec4 Scheme type, but we do want to
+ ;; accept colors and rects as vec4s since there is no special
+ ;; color or rect type in GLSL.
+ (if (rect? x)
+ (bytestruct-pack! <rect> ((() x)) bv i)
+ (bytestruct-pack! <color> ((() x)) bv i)))
#:setter gl-uniform4fv
#:null (make-null-rect))