Mesa (7.11): glsl: Split out part of variable_index_to_cond_assign_visitor: :needs_lowering
Ian Romanick
idr at kemper.freedesktop.org
Thu Jul 28 18:48:47 UTC 2011
Module: Mesa
Branch: 7.11
Commit: d31c1c33edaa238383c0b2d6a9fbd4a0289450f8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d31c1c33edaa238383c0b2d6a9fbd4a0289450f8
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Mon Jul 18 10:07:24 2011 -0700
glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit d2296e784aa8fad81c4910dcbbf61e826ce9a06a)
---
src/glsl/lower_variable_index_to_cond_assign.cpp | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/glsl/lower_variable_index_to_cond_assign.cpp b/src/glsl/lower_variable_index_to_cond_assign.cpp
index 45adb26..c0b69c8 100644
--- a/src/glsl/lower_variable_index_to_cond_assign.cpp
+++ b/src/glsl/lower_variable_index_to_cond_assign.cpp
@@ -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)
{
More information about the mesa-commit
mailing list