diff options
author | Ian Romanick <[email protected]> | 2013-03-15 15:23:19 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-04-08 15:17:05 -0700 |
commit | 58d93e324718a5a54f7e12b83d58ff5535be1c9c (patch) | |
tree | a2e478d70c27f3854eaa9ad788082374d4793c32 /src/glsl/ast_to_hir.cpp | |
parent | a131b87706a6e59be35997d24b2236130aa09689 (diff) |
glsl: Don't early-out for error-type inputs
Check the type of the array operand and the index operand before doing
other checks. This simplifies the code a bit now (eliminating the
error_emitted parameter), and enables some later functional changes.
The shader
uniform float x[6];
uniform sampler2D s;
void main() { gl_Position.x = xx[s + 1]; }
still generates (only) the two expected errors:
0:3(33): error: `xx' undeclared
0:3(39): error: Operands to arithmetic operators must be numeric
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index e9fa4a8cabf..a0ec71cde7b 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1514,10 +1514,8 @@ ast_expression::hir(exec_list *instructions, op[0] = subexpressions[0]->hir(instructions, state); op[1] = subexpressions[1]->hir(instructions, state); - error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); - result = _mesa_ast_array_index_to_hir(ctx, state, op[0], op[1], - loc, index_loc, error_emitted); + loc, index_loc); if (result->type->is_error()) error_emitted = true; |