diff options
Diffstat (limited to 'src/glsl/ir_reader.cpp')
-rw-r--r-- | src/glsl/ir_reader.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index a9cbf8ea944..7a22a945ec5 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -64,9 +64,12 @@ static ir_texture *read_texture(_mesa_glsl_parse_state *, s_list *); static ir_dereference *read_dereference(_mesa_glsl_parse_state *, s_expression *); -static ir_dereference *read_var_ref(_mesa_glsl_parse_state *, s_list *); -static ir_dereference *read_array_ref(_mesa_glsl_parse_state *, s_list *); -static ir_dereference *read_record_ref(_mesa_glsl_parse_state *, s_list *); +static ir_dereference_variable * +read_var_ref(_mesa_glsl_parse_state *, s_list *); +static ir_dereference_array * +read_array_ref(_mesa_glsl_parse_state *, s_list *); +static ir_dereference_record * +read_record_ref(_mesa_glsl_parse_state *, s_list *); void _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, @@ -260,7 +263,7 @@ read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list, return; s_list *paramlist = SX_AS_LIST(type_expr->next); - s_list *body_list = SX_AS_LIST(paramlist->next); + s_list *body_list = SX_AS_LIST(type_expr->next->next); if (paramlist == NULL || body_list == NULL) { ir_read_error(st, list, "Expected (signature <type> (parameters ...) " "(<instruction> ...))"); @@ -674,7 +677,7 @@ read_call(_mesa_glsl_parse_state *st, s_list *list) } s_symbol *name = SX_AS_SYMBOL(list->subexpressions.head->next); - s_list *params = SX_AS_LIST(name->next); + s_list *params = SX_AS_LIST(list->subexpressions.head->next->next); if (name == NULL || params == NULL) { ir_read_error(st, list, "expected (call <name> (<param> ...))"); return NULL; @@ -796,12 +799,6 @@ read_swizzle(_mesa_glsl_parse_state *st, s_list *list) } s_expression *sub = (s_expression*) swiz->next; - if (sub == NULL) { - ir_read_error(st, list, "expected rvalue: (swizzle %s <rvalue>)", - swiz->value()); - return NULL; - } - ir_rvalue *rvalue = read_rvalue(st, sub); if (rvalue == NULL) return NULL; @@ -930,7 +927,7 @@ read_dereference(_mesa_glsl_parse_state *st, s_expression *expr) return NULL; } -static ir_dereference * +static ir_dereference_variable * read_var_ref(_mesa_glsl_parse_state *st, s_list *list) { void *ctx = st; @@ -953,7 +950,7 @@ read_var_ref(_mesa_glsl_parse_state *st, s_list *list) return new(ctx) ir_dereference_variable(var); } -static ir_dereference * +static ir_dereference_array * read_array_ref(_mesa_glsl_parse_state *st, s_list *list) { void *ctx = st; @@ -974,7 +971,7 @@ read_array_ref(_mesa_glsl_parse_state *st, s_list *list) return new(ctx) ir_dereference_array(subject, idx); } -static ir_dereference * +static ir_dereference_record * read_record_ref(_mesa_glsl_parse_state *st, s_list *list) { void *ctx = st; @@ -1053,8 +1050,8 @@ read_texture(_mesa_glsl_parse_state *st, s_list *list) return NULL; } s_int *offset_x = SX_AS_INT(offset_list->subexpressions.head); - s_int *offset_y = SX_AS_INT(offset_x->next); - s_int *offset_z = SX_AS_INT(offset_y->next); + s_int *offset_y = SX_AS_INT(offset_list->subexpressions.head->next); + s_int *offset_z = SX_AS_INT(offset_list->subexpressions.head->next->next); if (offset_x == NULL || offset_y == NULL || offset_z == NULL) { ir_read_error(st, offset_list, "expected (<int> <int> <int>)"); return NULL; |