nir/vtn: Use return type rather than image type for tex ops
[mesa.git] / src / compiler / glsl / lower_subroutine.cpp
index e80c1be768a08aea0768d8f2521c75240446a89b..de178a59b07a2d30c16f38deeb3ad28474d56e26 100644 (file)
@@ -87,8 +87,9 @@ lower_subroutine_visitor::visit_leave(ir_call *ir)
 
    for (int s = this->state->num_subroutines - 1; s >= 0; s--) {
       ir_rvalue *var;
-      ir_constant *lc = new(mem_ctx)ir_constant(s);
       ir_function *fn = this->state->subroutines[s];
+      ir_constant *lc = new(mem_ctx)ir_constant(fn->subroutine_index);
+
       bool is_compat = false;
 
       for (int i = 0; i < fn->num_subroutine_types; i++) {