On 2016-03-31 21:57, Timothy Arceri wrote:
---
src/compiler/glsl/lower_packed_varyings.cpp | 25
+++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/compiler/glsl/lower_packed_varyings.cpp
b/src/compiler/glsl/lower_packed_varyings.cpp
index ad766bb..6e7a289 100644
--- a/src/compiler/glsl/lower_packed_varyings.cpp
+++ b/src/compiler/glsl/lower_packed_varyings.cpp
@@ -152,6 +152,31 @@
using namespace ir_builder;
+/**
+ * If the var is an array check if it matches the array attributes of
the
+ * packed var.
+ */
+static bool
+check_for_matching_arrays(ir_variable *packed_var, ir_variable *var)
+{
+ const glsl_type *pt = packed_var->type;
+ const glsl_type *vt = var->type;
I suppose its ok to always assume the call site always does the right
thing with
this helper? Either way,
Reviewed-by: Edward O'Callaghan <eocallag...@alterapraxis.com>
+ bool array_match = true;
+
+ while (pt->is_array() || vt->is_array()) {
+ if (pt->is_array() != vt->is_array() ||
+ pt->length != vt->length) {
+ array_match = false;
+ break;
+ } else {
+ pt = pt->fields.array;
+ vt = vt->fields.array;
+ }
+ }
+
+ return array_match;
+}
+
static bool
needs_lowering(ir_variable *var, bool has_enhanced_layouts,
bool disable_varying_packing)
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev