glsl: Refactor handling of ast_array_index to a separate function

I love 800+ line switch-statements as much as the next guy... Future
commits will make changes to this part of the AST-to-HIR conversion, and
extracting this code will make that a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Ian Romanick
2013-03-15 14:10:12 -07:00
parent cd39ae7394
commit 46934adb8d
4 changed files with 205 additions and 162 deletions

View File

@@ -854,6 +854,13 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
exec_list *instructions,
struct _mesa_glsl_parse_state *state);
extern ir_rvalue *
_mesa_ast_array_index_to_hir(void *mem_ctx,
struct _mesa_glsl_parse_state *state,
ir_rvalue *array, ir_rvalue *idx,
YYLTYPE &loc, YYLTYPE &idx_loc,
bool error_emitted);
void
emit_function(_mesa_glsl_parse_state *state, ir_function *f);