summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-03-05 12:16:22 +1100
committerTimothy Arceri <[email protected]>2016-03-31 12:49:55 +1100
commit13f6c788ebc4f9969d2d12c1a8ba64fdcf5dc12e (patch)
treece5a9ca03a4948d0b27e14d25a4444f9a3aaf69f /src/compiler/glsl/ast_to_hir.cpp
parent52caeee7e78c2bed0329dcb7a5984826fa5960a6 (diff)
glsl: move process_qualifier_constant() to ast_type.cpp
We will make use of this function being here in the following patch. Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 0c686b27229..673ce8f716f 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2585,47 +2585,6 @@ validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state,
}
static bool
-process_qualifier_constant(struct _mesa_glsl_parse_state *state,
- YYLTYPE *loc,
- const char *qual_indentifier,
- ast_expression *const_expression,
- unsigned *value)
-{
- exec_list dummy_instructions;
-
- if (const_expression == NULL) {
- *value = 0;
- return true;
- }
-
- ir_rvalue *const ir = const_expression->hir(&dummy_instructions, state);
-
- ir_constant *const const_int = ir->constant_expression_value();
- if (const_int == NULL || !const_int->type->is_integer()) {
- _mesa_glsl_error(loc, state, "%s must be an integral constant "
- "expression", qual_indentifier);
- return false;
- }
-
- if (const_int->value.i[0] < 0) {
- _mesa_glsl_error(loc, state, "%s layout qualifier is invalid (%d < 0)",
- qual_indentifier, const_int->value.u[0]);
- return false;
- }
-
- /* If the location is const (and we've verified that
- * it is) then no instructions should have been emitted
- * when we converted it to HIR. If they were emitted,
- * then either the location isn't const after all, or
- * we are emitting unnecessary instructions.
- */
- assert(dummy_instructions.is_empty());
-
- *value = const_int->value.u[0];
- return true;
-}
-
-static bool
validate_stream_qualifier(YYLTYPE *loc, struct _mesa_glsl_parse_state *state,
unsigned stream)
{