From: Eric Anholt Date: Wed, 31 Mar 2010 09:40:14 +0000 (-1000) Subject: Test that discard only appears in the fragment shader. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b98020770730bd4a7e9bd5c2e4ab2ae8c1eb0376;p=mesa.git Test that discard only appears in the fragment shader. Fixes fragmentOnly4.vert. --- diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index a0fe37b5485..f66c0298085 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;