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:
parent
6ca1ab3bb4
commit
5c92b3c460
|
@ -1785,10 +1785,8 @@ bi_is_simple_tex(nir_tex_instr *instr)
|
||||||
if (instr->op != nir_texop_tex && instr->op != nir_texop_txl)
|
if (instr->op != nir_texop_tex && instr->op != nir_texop_txl)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
nir_alu_type base = nir_alu_type_get_base_type(instr->dest_type);
|
if (instr->dest_type != nir_type_float32 &&
|
||||||
unsigned sz = nir_dest_bit_size(instr->dest);
|
instr->dest_type != nir_type_float16)
|
||||||
|
|
||||||
if (!(base == nir_type_float && (sz == 16 || sz == 32)))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (instr->is_shadow || instr->is_array)
|
if (instr->is_shadow || instr->is_array)
|
||||||
|
|
|
@ -2118,7 +2118,6 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
|
||||||
int sampler_index = texture_index;
|
int sampler_index = texture_index;
|
||||||
|
|
||||||
nir_alu_type dest_base = nir_alu_type_get_base_type(instr->dest_type);
|
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 */
|
/* texture instructions support float outmods */
|
||||||
unsigned outmod = midgard_outmod_none;
|
unsigned outmod = midgard_outmod_none;
|
||||||
|
@ -2131,7 +2130,7 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
|
||||||
.mask = 0xF,
|
.mask = 0xF,
|
||||||
.dest = nir_dest_index(dest),
|
.dest = nir_dest_index(dest),
|
||||||
.src = { ~0, ~0, ~0, ~0 },
|
.src = { ~0, ~0, ~0, ~0 },
|
||||||
.dest_type = dest_type,
|
.dest_type = instr->dest_type,
|
||||||
.swizzle = SWIZZLE_IDENTITY_4,
|
.swizzle = SWIZZLE_IDENTITY_4,
|
||||||
.outmod = outmod,
|
.outmod = outmod,
|
||||||
.op = midgard_texop,
|
.op = midgard_texop,
|
||||||
|
|
Loading…
Reference in New Issue