freedreno/ir3: Fold 16-bit conversions into image load/store src/dsts.

Shaves 5 instructions off of one manhattan31 shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16616>
This commit is contained in:
Emma Anholt 2022-05-19 13:41:34 -07:00 committed by Marge Bot
parent f005a2d786
commit 49dc60efa1
2 changed files with 3 additions and 1 deletions

View File

@ -116,7 +116,7 @@ type_t
ir3_get_type_for_image_intrinsic(const nir_intrinsic_instr *instr)
{
const nir_intrinsic_info *info = &nir_intrinsic_infos[instr->intrinsic];
int bit_size = info->has_dest ? nir_dest_bit_size(instr->dest) : 32;
int bit_size = info->has_dest ? nir_dest_bit_size(instr->dest) : nir_src_bit_size(instr->src[3]);
nir_alu_type type = nir_type_uint;
switch (instr->intrinsic) {

View File

@ -755,6 +755,8 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
(1 << nir_tex_src_ddy),
~0);
OPT(s, nir_fold_16bit_image_load_store_conversions);
/* Now that we stripped off the 16-bit conversions, legalize so that we
* don't have a mix of 16- and 32-bit args that will need to be
* collected together in the coordinate vector.