summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-02-17 20:33:38 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-06-08 08:14:41 -0400
commit9955b8e5c996430beb3c8b205ae35830558e7a9c (patch)
treee39b1485b32b6302f633f803b6489c6afb377840
parent90c590e10ee91600290f6f7858f91d0d2bc160e6 (diff)
Add pre-process? arg to make-shader.
-rw-r--r--chickadee/graphics/shader.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/chickadee/graphics/shader.scm b/chickadee/graphics/shader.scm
index 8855641..70858fa 100644
--- a/chickadee/graphics/shader.scm
+++ b/chickadee/graphics/shader.scm
@@ -520,7 +520,7 @@
#:bind bind-shader)
(define* (make-shader vertex-port fragment-port #:key
- uniform-map)
+ uniform-map (pre-process? #t))
"Read GLSL source from VERTEX-PORT and FRAGMENT-PORT and compile
them into a GPU shader program."
(define (shader-compiled? id)
@@ -570,8 +570,10 @@ them into a GPU shader program."
(define (make-shader-stage type port)
(let ((id (gl-create-shader type))
(source (string->utf8
- (string-append (glsl-preprocessor-source)
- (get-string-all port)))))
+ (if pre-process?
+ (string-append (glsl-preprocessor-source)
+ (get-string-all port))
+ (get-string-all port)))))
(gl-shader-source id 1
(bytevector->pointer
(u64vector