diff options
author | Eric Anholt <eric@anholt.net> | 2010-03-30 23:40:14 -1000 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-03-30 23:40:14 -1000 |
commit | b98020770730bd4a7e9bd5c2e4ab2ae8c1eb0376 (patch) | |
tree | f1c6f3a5c4c45210c0c6f7b32cc4c2ad6fc4d630 | |
parent | 174cc03edcd6861ba416cc1afb19d4d43933ac84 (diff) |
Test that discard only appears in the fragment shader.
Fixes fragmentOnly4.vert.
-rw-r--r-- | ast_to_hir.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index a0fe37b548..f66c029808 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -1591,6 +1591,16 @@ ast_jump_statement::hir(exec_list *instructions, instructions->push_tail(inst); } + if (mode == ast_discard) { + /* FINISHME: discard support */ + if (state->target != fragment_shader) { + YYLTYPE loc = this->get_location(); + + _mesa_glsl_error(& loc, state, + "`discard' may only appear in a fragment shader"); + } + } + /* Jump instructions do not have r-values. */ return NULL; |