aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 194d3099060..214412bc30a 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -6465,6 +6465,25 @@ ast_jump_statement::hir(exec_list *instructions,
ir_rvalue *
+ast_demote_statement::hir(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ void *ctx = state;
+
+ if (state->stage != MESA_SHADER_FRAGMENT) {
+ YYLTYPE loc = this->get_location();
+
+ _mesa_glsl_error(& loc, state,
+ "`demote' may only appear in a fragment shader");
+ }
+
+ instructions->push_tail(new(ctx) ir_demote);
+
+ return NULL;
+}
+
+
+ir_rvalue *
ast_selection_statement::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{