Commit 4b5e8eb3 authored by Kenneth Graunke's avatar Kenneth Graunke

st/mesa: Record samplers for extra planes in info->textures_used.

Normally gl_nir_lower_samplers_as_deref records info->textures_used
for us, but this pass runs after that, attempting to assign samplers
in the same order as st_atom_texture's external_samplers_used loop
so the stars align and we get the same locations.

Since we're adding textures late, we need to amend info->textures_used.

iris uses info->textures_used to set up texture bindings; this fixes
Piglit's ext_image_dma_buf_import-sample-{nv12,yuv420,yvu420} there.
Reviewed-by: Rob Clark's avatarRob Clark <robdclark@gmail.com>
parent 8a995f2b
Pipeline #37319 passed with stages
in 10 minutes and 38 seconds
......@@ -33,6 +33,8 @@
#include "st_nir.h"
typedef struct {
struct shader_info *info;
unsigned lower_2plane;
unsigned lower_3plane;
......@@ -85,6 +87,8 @@ lower_tex_src_plane_block(lower_tex_src_state *state, nir_block *block)
tex->texture_index = tex->sampler_index =
state->sampler_map[y_samp][plane[0].i32 - 1];
state->info->textures_used |= 1u << tex->texture_index;
}
nir_tex_instr_remove_src(tex, plane_index);
......@@ -108,6 +112,7 @@ st_nir_lower_tex_src_plane(struct nir_shader *shader, unsigned free_slots,
{
lower_tex_src_state state = {0};
state.info = &shader->info;
state.lower_2plane = lower_2plane;
state.lower_3plane = lower_3plane;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment