summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-02-23 08:46:49 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-06-08 08:14:41 -0400
commitb68d41b50b082129e714f352e1e29e2ed769119a (patch)
tree17cc8fb0986a52ee2deb594eecc13129c4010135
parent092e3e63f5ba488bee998b3246ed309c9578341b (diff)
Extract discard expansion to a procedure.
-rw-r--r--chickadee/graphics/seagull.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm
index ef6ec1f..11b38eb 100644
--- a/chickadee/graphics/seagull.scm
+++ b/chickadee/graphics/seagull.scm
@@ -521,6 +521,11 @@
(expand exp stage env)))
names exps)))
+(define (expand:discard stage env)
+ (if (eq? stage 'fragment)
+ '(outputs)
+ (seagull-syntax-error "discard not allowed in vertex shader" exp expand)))
+
(define (expand exp stage env)
(define (primitive-call-for-stage? x)
(primitive-call? x stage))
@@ -574,9 +579,7 @@
(('case key clauses ...)
(expand:case key clauses stage env))
(('discard)
- (if (eq? stage 'fragment)
- '(outputs)
- (seagull-syntax-error "discard not allowed in vertex shader" exp expand)))
+ (expand:discard stage env))
;; Primitive calls:
(((? primitive-call-for-stage? operator) args ...)
(expand:primitive-call operator args stage env))