From db3a64fcea6318ab5ded186a347e732b7956f1f7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 30 Dec 2015 16:48:59 -0800 Subject: [PATCH] nir/spirv: Use shader stage for determining variable locations --- src/glsl/nir/spirv/spirv_to_nir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index e184ef93359..5e8ec8f8260 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -1690,10 +1690,10 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, vtn_foreach_decoration(b, val, var_decoration_cb, var); if (!var->data.explicit_location) { - if (b->execution_model == SpvExecutionModelFragment && + if (b->shader->stage == MESA_SHADER_FRAGMENT && var->data.mode == nir_var_shader_out) { var->data.location += FRAG_RESULT_DATA0; - } else if (b->execution_model == SpvExecutionModelVertex && + } else if (b->shader->stage == MESA_SHADER_VERTEX && var->data.mode == nir_var_shader_in) { var->data.location += VERT_ATTRIB_GENERIC0; } else if (var->data.mode == nir_var_shader_in || -- 2.30.2