From b98020770730bd4a7e9bd5c2e4ab2ae8c1eb0376 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 30 Mar 2010 23:40:14 -1000 Subject: [PATCH] Test that discard only appears in the fragment shader. Fixes fragmentOnly4.vert. --- ast_to_hir.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index a0fe37b..f66c029 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; -- 2.7.4