glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 18 Jul 2011 17:07:24 +0000 (10:07 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 23 Jul 2011 08:24:18 +0000 (01:24 -0700)
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/lower_variable_index_to_cond_assign.cpp

index 45adb267f2c54a9880b884c58b3ad4f43c10c8b5..c0b69c8f0b175594ed2e3f410097cc6527a89298 100644 (file)
@@ -239,12 +239,8 @@ public:
    bool lower_temps;
    bool lower_uniforms;
 
-   bool needs_lowering(ir_dereference_array *deref) const
+   bool storage_type_needs_lowering(ir_dereference_array *deref) const
    {
-      if (deref == NULL || deref->array_index->as_constant()
-         || !is_array_or_matrix(deref->array))
-        return false;
-
       if (deref->array->ir_type == ir_type_constant)
         return this->lower_temps;
 
@@ -268,6 +264,15 @@ public:
       return false;
    }
 
+   bool needs_lowering(ir_dereference_array *deref) const
+   {
+      if (deref == NULL || deref->array_index->as_constant()
+         || !is_array_or_matrix(deref->array))
+        return false;
+
+      return this->storage_type_needs_lowering(deref);
+   }
+
    ir_variable *convert_dereference_array(ir_dereference_array *orig_deref,
                                          ir_assignment* orig_assign)
    {