From 6298347ec71e7e03c02bf262f37d176dbcc2b987 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 24 Mar 2021 22:46:24 +0100 Subject: [PATCH] mesa/st: fix lower_tex_src_plane in multiple samplers scenario MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit "plane[0].i32" is the plane being lowered, it's not the sampler we're looking for. It worked when there's a single sampler because, eg for NV12, plane[0].i32 for the UV plane would be 1 and the added ":uv" sampler would also land at binding point 1. Fixes: 079e5f73d72 ("mesa/st: rewrite src var when lowering tex_src_plane") Reviewed-by: Marek Olšák Part-of: --- src/mesa/state_tracker/st_nir_lower_tex_src_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_nir_lower_tex_src_plane.c b/src/mesa/state_tracker/st_nir_lower_tex_src_plane.c index 1701a64..edd80fb 100644 --- a/src/mesa/state_tracker/st_nir_lower_tex_src_plane.c +++ b/src/mesa/state_tracker/st_nir_lower_tex_src_plane.c @@ -139,7 +139,7 @@ lower_tex_src_plane_block(nir_builder *b, lower_tex_src_state *state, nir_block if (tex_index >= 0 && samp_index >= 0) { b->cursor = nir_before_instr(&tex->instr); - nir_variable* samp = find_sampler(state, plane[0].i32); + nir_variable* samp = find_sampler(state, tex->sampler_index); assert(samp); nir_deref_instr *tex_deref_instr = nir_build_deref_var(b, samp); -- 2.7.4