nir_lower_readonly_images_to_tex: Fix typeo on image arrays

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12119>
This commit is contained in:
Enrico Galli 2021-07-28 17:02:09 -07:00 committed by Marge Bot
parent 486e236c33
commit 16ef26ffcb
1 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ lower_readonly_image_op(nir_builder *b, nir_instr *instr, void *context)
unsigned coord_components =
glsl_get_sampler_dim_coordinate_components(tex->sampler_dim);
if (glsl_sampler_type_is_array(deref->type))
tex->coord_components++;
coord_components++;
tex->src[0].src_type = nir_tex_src_texture_deref;
tex->src[0].src = nir_src_for_ssa(&deref->dest.ssa);
@ -141,10 +141,10 @@ lower_readonly_image_op(nir_builder *b, nir_instr *instr, void *context)
replace_image_type_with_sampler(deref);
}
tex->coord_components = coord_components;
switch (intrin->intrinsic) {
case nir_intrinsic_image_deref_load: {
assert(intrin->src[1].is_ssa);
tex->coord_components = coord_components;
nir_ssa_def *coord =
nir_channels(b, intrin->src[1].ssa,
(1 << tex->coord_components) - 1);