[Mesa-dev] [PATCH] glsl: remove unnecessary check

Timothy Arceri t_arceri at yahoo.com.au
Fri Jul 18 04:47:23 PDT 2014


This code does nothing useful as the next recursive call on the array element will override any null values if the element is a record anyway. The code is also not doing what the comment says as its trying to set the record type pointer for only the first element of the array not the first leaf field of the record.

Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---

Resending this patch. Its a required cleanup for arrays of arrays. 

 src/glsl/link_uniforms.cpp | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index ba66053..9566124 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -187,9 +187,6 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
       }
    } else if (t->is_array() && (t->fields.array->is_record()
                                 || t->fields.array->is_interface())) {
-      if (record_type == NULL && t->fields.array->is_record())
-         record_type = t->fields.array;
-
       for (unsigned i = 0; i < t->length; i++) {
 	 size_t new_length = name_length;
 
@@ -198,11 +195,6 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
 
          recursion(t->fields.array, name, new_length, row_major,
                    record_type);
-
-         /* Only the first leaf-field of the record gets called with the
-          * record type pointer.
-          */
-         record_type = NULL;
       }
    } else {
       this->visit_field(t, *name, row_major, record_type);
-- 
1.9.3



More information about the mesa-dev mailing list