glsl: move ir_var_out code
authorBrian Paul <brianp@vmware.com>
Thu, 27 Jan 2011 04:16:14 +0000 (21:16 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 27 Jan 2011 04:16:14 +0000 (21:16 -0700)
src/mesa/program/ir_to_mesa.cpp

index daedcadc9dfb5310445e56ae6bae2f2cb514b629..b7746a6e30c93b6581737ea13072d210d4be4c67 100644 (file)
@@ -1485,7 +1485,6 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
         this->variables.push_tail(entry);
         break;
       case ir_var_in:
-      case ir_var_out:
       case ir_var_inout:
         /* The linker assigns locations for varyings and attributes,
          * including deprecated builtins (like gl_Color), user-assign
@@ -1509,12 +1508,13 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
                                   var->type->gl_type,
                                   var->location - VERT_ATTRIB_GENERIC0);
            }
-        } else {
-           entry = new(mem_ctx) variable_storage(var,
-                                                 PROGRAM_OUTPUT,
-                                                 var->location);
-        }
-
+         }
+         break;
+      case ir_var_out:
+        assert(var->location != -1);
+         entry = new(mem_ctx) variable_storage(var,
+                                               PROGRAM_OUTPUT,
+                                               var->location);
         break;
       case ir_var_system_value:
          entry = new(mem_ctx) variable_storage(var,