nir/spirv: Use shader stage for determining variable locations
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 31 Dec 2015 00:48:59 +0000 (16:48 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 31 Dec 2015 01:45:43 +0000 (17:45 -0800)
src/glsl/nir/spirv/spirv_to_nir.c

index e184ef93359e9cff092ca276e13b597c64ec7291..5e8ec8f826024a9264da51e4315b822b655cdf33 100644 (file)
@@ -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 ||