broadcom/compiler: Handle non-SSA destinations for tex instructions

The NIR that is given to the VIR compiler is not in SSA form, and so
the v3d*_vir_emit_tex() functions must be able to handle both SSA and
register destinations.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7318>
This commit is contained in:
Arcady Goldmints-Orlov
2020-10-26 11:57:32 -04:00
committed by Marge Bot
parent e331fd7fc4
commit 0b30336906
2 changed files with 6 additions and 4 deletions

View File

@@ -175,9 +175,10 @@ v3d40_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
/* Limit the number of channels returned to both how many the NIR
* instruction writes and how many the instruction could produce.
*/
assert(instr->dest.is_ssa);
p0_unpacked.return_words_of_texture_data =
nir_ssa_def_components_read(&instr->dest.ssa);
instr->dest.is_ssa ?
nir_ssa_def_components_read(&instr->dest.ssa) :
(1 << instr->dest.reg.reg->num_components) - 1;
assert(p0_unpacked.return_words_of_texture_data != 0);