diff options
-rw-r--r-- | chickadee/graphics/shader.scm | 8 |
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 |