summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-02-16 20:51:05 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-06-08 08:14:41 -0400
commit92a3951c0823c3be804ca92c78710a6a3d1e7a69 (patch)
treec480bec2f5a364cbc1c388dfd8831b1e1f8c4519
parent46d11696f3189c1e68bc41b36754f9a62f483286 (diff)
Add discard as an alias to empty outputs.
-rw-r--r--chickadee/graphics/seagull.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm
index 515c9e1..c5452b0 100644
--- a/chickadee/graphics/seagull.scm
+++ b/chickadee/graphics/seagull.scm
@@ -39,9 +39,8 @@
;;
;; TODO:
;; - Loops
-;; - discard
;; - (define ...) form
-;; - struct field aliases (rgba for vec4, for example)
+;; - struct field aliases (rgba for vec4, for example) maybe a bad idea??
;; - Scheme shader type -> GLSL struct translation
;; - Dead code elimination (error when a uniform is eliminated)
;; - User defined structs
@@ -504,6 +503,10 @@
(expand:cond clauses stage env))
(('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)))
;; Primitive calls:
(((? primitive-call-for-stage? operator) args ...)
(expand:primitive-call operator args stage env))