panfrost: Assume that nir_tex_instr::dest_type is sized

Get rid of some now-redundant code, and cleanup the is-float check in
the bifrost compiler.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
This commit is contained in:
Connor Abbott 2020-12-08 15:15:35 +01:00
parent 6ca1ab3bb4
commit 5c92b3c460
2 changed files with 3 additions and 6 deletions

View File

@ -1785,10 +1785,8 @@ bi_is_simple_tex(nir_tex_instr *instr)
if (instr->op != nir_texop_tex && instr->op != nir_texop_txl)
return false;
nir_alu_type base = nir_alu_type_get_base_type(instr->dest_type);
unsigned sz = nir_dest_bit_size(instr->dest);
if (!(base == nir_type_float && (sz == 16 || sz == 32)))
if (instr->dest_type != nir_type_float32 &&
instr->dest_type != nir_type_float16)
return false;
if (instr->is_shadow || instr->is_array)

View File

@ -2118,7 +2118,6 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
int sampler_index = texture_index;
nir_alu_type dest_base = nir_alu_type_get_base_type(instr->dest_type);
nir_alu_type dest_type = dest_base | nir_dest_bit_size(*dest);
/* texture instructions support float outmods */
unsigned outmod = midgard_outmod_none;
@ -2131,7 +2130,7 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
.mask = 0xF,
.dest = nir_dest_index(dest),
.src = { ~0, ~0, ~0, ~0 },
.dest_type = dest_type,
.dest_type = instr->dest_type,
.swizzle = SWIZZLE_IDENTITY_4,
.outmod = outmod,
.op = midgard_texop,