From b72936fdadfe9bd2484e142b7b5573d7e4adad34 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 25 Jun 2015 17:31:07 -0700 Subject: [PATCH] nir/spirv: Actually put variables on the right linked list --- src/glsl/nir/spirv_to_nir.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index 2b7eda39008..fbf6969f2fd 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -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; } -- 2.30.2