nir/spirv: Actually put variables on the right linked list
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 Jun 2015 00:31:07 +0000 (17:31 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 Jun 2015 00:36:34 +0000 (17:36 -0700)
src/glsl/nir/spirv_to_nir.c

index 2b7eda3900844b3ab248691c25ee59d0c4eb991b..fbf6969f2fd35daa22aba8d1365f44605cd594ee 100644 (file)
@@ -565,15 +565,30 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
             vtn_value(b, w[4], vtn_value_type_constant)->constant;
       }
 
-      if (var->data.mode == nir_var_local) {
-         exec_list_push_tail(&b->impl->locals, &var->node);
-      } else {
-         exec_list_push_tail(&b->shader->globals, &var->node);
-      }
-
       val->deref = nir_deref_var_create(b, var);
 
       vtn_foreach_decoration(b, val, var_decoration_cb, var);
+
+      switch (var->data.mode) {
+      case nir_var_shader_in:
+         exec_list_push_tail(&b->shader->inputs, &var->node);
+         break;
+      case nir_var_shader_out:
+         exec_list_push_tail(&b->shader->outputs, &var->node);
+         break;
+      case nir_var_global:
+         exec_list_push_tail(&b->shader->globals, &var->node);
+         break;
+      case nir_var_local:
+         exec_list_push_tail(&b->impl->locals, &var->node);
+         break;
+      case nir_var_uniform:
+         exec_list_push_tail(&b->shader->uniforms, &var->node);
+         break;
+      case nir_var_system_value:
+         exec_list_push_tail(&b->shader->system_values, &var->node);
+         break;
+      }
       break;
    }