linker: Make lower_packed_varyings work with explicit locations
authorIan Romanick <ian.d.romanick@intel.com>
Sun, 27 Apr 2014 21:16:48 +0000 (14:16 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 2 May 2014 14:16:54 +0000 (07:16 -0700)
Don't do anything with variables that have explicitly assigned
locations.  This is also how built-in varyings are handled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/lower_packed_varyings.cpp

index 35f1c5f60cc59ff2aa3bda77fba87301ed5008a4..e8654748f5b5bce95c8418ee17524784bcc0329e 100644 (file)
@@ -584,7 +584,12 @@ lower_packed_varyings_visitor::get_packed_varying_deref(
 bool
 lower_packed_varyings_visitor::needs_lowering(ir_variable *var)
 {
-   /* Things composed of vec4's don't need lowering.  Everything else does. */
+   /* Things composed of vec4's and varyings with explicitly assigned
+    * locations don't need lowering.  Everything else does.
+    */
+   if (var->data.explicit_location)
+      return false;
+
    const glsl_type *type = var->type;
    if (this->gs_input_vertices != 0) {
       assert(type->is_array());