ac/nir: set .image_dim and .image_array for all opcodes

for consistency

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31187>
This commit is contained in:
Marek Olšák
2024-09-11 03:36:12 -04:00
committed by Marge Bot
parent 14b576e023
commit 163222abd0
3 changed files with 16 additions and 5 deletions
+9 -3
View File
@@ -252,7 +252,9 @@ static bool lower_resinfo(nir_builder *b, nir_instr *instr, void *data)
dim = nir_intrinsic_image_dim(intr);
is_array = nir_intrinsic_image_array(intr);
desc = nir_image_descriptor_amd(b, dim == GLSL_SAMPLER_DIM_BUF ? 4 : 8,
32, intr->src[0].ssa);
32, intr->src[0].ssa,
.image_dim = dim,
.image_array = is_array);
break;
case nir_intrinsic_image_deref_size:
@@ -261,7 +263,9 @@ static bool lower_resinfo(nir_builder *b, nir_instr *instr, void *data)
dim = glsl_get_sampler_dim(type);
is_array = glsl_sampler_type_is_array(type);
desc = nir_image_deref_descriptor_amd(b, dim == GLSL_SAMPLER_DIM_BUF ? 4 : 8,
32, intr->src[0].ssa);
32, intr->src[0].ssa,
.image_dim = dim,
.image_array = is_array);
break;
case nir_intrinsic_bindless_image_size:
@@ -269,7 +273,9 @@ static bool lower_resinfo(nir_builder *b, nir_instr *instr, void *data)
dim = nir_intrinsic_image_dim(intr);
is_array = nir_intrinsic_image_array(intr);
desc = nir_bindless_image_descriptor_amd(b, dim == GLSL_SAMPLER_DIM_BUF ? 4 : 8,
32, intr->src[0].ssa);
32, intr->src[0].ssa,
.image_dim = dim,
.image_array = is_array);
break;
default:
+4 -1
View File
@@ -392,7 +392,10 @@ ac_create_blit_cs(const struct ac_cs_blit_options *options, const union ac_cs_bl
/* We need to load the descriptor here, otherwise the load would be after optimization
* barriers waiting for image loads, i.e. after s_waitcnt vmcnt(0).
*/
nir_def *img_dst_desc = nir_image_deref_descriptor_amd(&b, 8, 32, deref_ssa(&b, img_dst));
nir_def *img_dst_desc =
nir_image_deref_descriptor_amd(&b, 8, 32, deref_ssa(&b, img_dst),
.image_dim = img_dst->type->sampler_dimensionality,
.image_array = img_dst->type->sampler_array);
if (lane_size > 1 && !b.shader->info.use_aco_amd)
img_dst_desc = nir_optimization_barrier_sgpr_amd(&b, 32, img_dst_desc);
@@ -202,7 +202,9 @@ void *si_clear_image_dcc_single_shader(struct si_context *sctx, bool is_msaa, un
/* Store the clear color. */
nir_image_deref_store(&b, &nir_build_deref_var(&b, output_img)->def, coord, nir_imm_int(&b, 0),
clear_color, nir_imm_int(&b, 0));
clear_color, nir_imm_int(&b, 0),
.image_dim = img_type->sampler_dimensionality,
.image_array = img_type->sampler_array);
return si_create_shader_state(sctx, b.shader);
}