diff --git a/src/compiler/nir/nir_remove_tex_shadow.c b/src/compiler/nir/nir_remove_tex_shadow.c index 8646821a1e4..9e1e1ba128c 100644 --- a/src/compiler/nir/nir_remove_tex_shadow.c +++ b/src/compiler/nir/nir_remove_tex_shadow.c @@ -85,7 +85,8 @@ remove_tex_shadow(struct nir_builder *b, nir_instr *instr, void *data) sampler->type = strip_shadow_with_array(sampler->type); sampler_deref->type = sampler->type; } else { - sampler = nir_find_variable_with_location(b->shader, nir_var_uniform, tex->sampler_index); + sampler = nir_find_sampler_variable_with_tex_index(b->shader, + tex->texture_index); sampler->type = strip_shadow_with_array(sampler->type); }