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:
parent
486e236c33
commit
16ef26ffcb
|
@ -131,7 +131,7 @@ lower_readonly_image_op(nir_builder *b, nir_instr *instr, void *context)
|
||||||
unsigned coord_components =
|
unsigned coord_components =
|
||||||
glsl_get_sampler_dim_coordinate_components(tex->sampler_dim);
|
glsl_get_sampler_dim_coordinate_components(tex->sampler_dim);
|
||||||
if (glsl_sampler_type_is_array(deref->type))
|
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_type = nir_tex_src_texture_deref;
|
||||||
tex->src[0].src = nir_src_for_ssa(&deref->dest.ssa);
|
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);
|
replace_image_type_with_sampler(deref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tex->coord_components = coord_components;
|
||||||
switch (intrin->intrinsic) {
|
switch (intrin->intrinsic) {
|
||||||
case nir_intrinsic_image_deref_load: {
|
case nir_intrinsic_image_deref_load: {
|
||||||
assert(intrin->src[1].is_ssa);
|
assert(intrin->src[1].is_ssa);
|
||||||
tex->coord_components = coord_components;
|
|
||||||
nir_ssa_def *coord =
|
nir_ssa_def *coord =
|
||||||
nir_channels(b, intrin->src[1].ssa,
|
nir_channels(b, intrin->src[1].ssa,
|
||||||
(1 << tex->coord_components) - 1);
|
(1 << tex->coord_components) - 1);
|
||||||
|
|
Loading…
Reference in New Issue