radeon / r200: Pass the API into _mesa_initialize_context
[mesa.git] / src / glsl / opt_array_splitting.cpp
index 34ac836ae5cfc78b1d44e855a4d9df7e61659c95..f37d0902201e4a2a49bd250423c5ad22e8d6aca2 100644 (file)
@@ -122,8 +122,8 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var)
 {
    assert(var);
 
-   if (var->mode != ir_var_auto &&
-       var->mode != ir_var_temporary)
+   if (var->data.mode != ir_var_auto &&
+       var->data.mode != ir_var_temporary)
       return NULL;
 
    if (!(var->type->is_array() || var->type->is_matrix()))
@@ -132,11 +132,11 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var)
    /* If the array hasn't been sized yet, we can't split it.  After
     * linking, this should be resolved.
     */
-   if (var->type->is_array() && var->type->length == 0)
+   if (var->type->is_unsized_array())
       return NULL;
 
-   foreach_iter(exec_list_iterator, iter, this->variable_list) {
-      variable_entry *entry = (variable_entry *)iter.get();
+   foreach_list(n, &this->variable_list) {
+      variable_entry *entry = (variable_entry *) n;
       if (entry->var == var)
         return entry;
    }
@@ -224,8 +224,8 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions,
    }
 
    /* Trim out variables we found that we can't split. */
-   foreach_iter(exec_list_iterator, iter, variable_list) {
-      variable_entry *entry = (variable_entry *)iter.get();
+   foreach_list_safe(n, &variable_list) {
+      variable_entry *entry = (variable_entry *) n;
 
       if (debug) {
         printf("array %s@%p: decl %d, split %d\n",
@@ -270,8 +270,8 @@ ir_array_splitting_visitor::get_splitting_entry(ir_variable *var)
 {
    assert(var);
 
-   foreach_iter(exec_list_iterator, iter, *this->variable_list) {
-      variable_entry *entry = (variable_entry *)iter.get();
+   foreach_list(n, this->variable_list) {
+      variable_entry *entry = (variable_entry *) n;
       if (entry->var == var) {
         return entry;
       }
@@ -368,8 +368,8 @@ optimize_split_arrays(exec_list *instructions, bool linked)
    /* Replace the decls of the arrays to be split with their split
     * components.
     */
-   foreach_iter(exec_list_iterator, iter, refs.variable_list) {
-      variable_entry *entry = (variable_entry *)iter.get();
+   foreach_list(n, &refs.variable_list) {
+      variable_entry *entry = (variable_entry *) n;
       const struct glsl_type *type = entry->var->type;
       const struct glsl_type *subtype;