Mesa (7.9): linker: Fix regressions caused by previous commit

Ian Romanick idr at kemper.freedesktop.org
Mon Dec 27 21:33:18 UTC 2010


Module: Mesa
Branch: 7.9
Commit: edfe057f94729e87b6c460907e3e28a401142c4e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=edfe057f94729e87b6c460907e3e28a401142c4e

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Dec  7 19:00:44 2010 -0800

linker: Fix regressions caused by previous commit

That's what I get for not running piglit before pushing.

Don't try to patch types of unsized arrays when linking fails.

Don't try to patch types of unsized arrays that are shared between
shader stages.
(cherry picked from commit 002cd2c8d439729227c79093bdbf8a269e72c19f)

---

 src/glsl/linker.cpp |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index a206994..5843953 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -858,23 +858,27 @@ link_intrastage_shaders(void *mem_ctx,
     * unspecified sizes have a size specified.  The size is inferred from the
     * max_array_access field.
     */
-   foreach_list(node, linked->ir) {
-      ir_variable *const var = ((ir_instruction *) node)->as_variable();
+   if (linked != NULL) {
+      foreach_list(node, linked->ir) {
+	 ir_variable *const var = ((ir_instruction *) node)->as_variable();
 
-      if (var == NULL)
-	 continue;
+	 if (var == NULL)
+	    continue;
 
-      if (!var->type->is_array() || (var->type->length != 0))
-	 continue;
+	 if ((var->mode != ir_var_auto) && (var->mode != ir_var_temporary))
+	    continue;
 
-      const glsl_type *type =
-	 glsl_type::get_array_instance(var->type->fields.array,
-				       var->max_array_access);
+	 if (!var->type->is_array() || (var->type->length != 0))
+	    continue;
 
-      assert(type != NULL);
-      var->type = type;
-   }
+	 const glsl_type *type =
+	    glsl_type::get_array_instance(var->type->fields.array,
+					  var->max_array_access);
 
+	 assert(type != NULL);
+	 var->type = type;
+      }
+   }
 
    return linked;
 }




More information about the mesa-commit mailing list