glsl: Don't early-out for error-type inputs
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 15 Mar 2013 22:23:19 +0000 (15:23 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 8 Apr 2013 22:17:05 +0000 (15:17 -0700)
commit58d93e324718a5a54f7e12b83d58ff5535be1c9c
treea2e478d70c27f3854eaa9ad788082374d4793c32
parenta131b87706a6e59be35997d24b2236130aa09689
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 <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ast.h
src/glsl/ast_array_index.cpp
src/glsl/ast_to_hir.cpp