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:

committed by
Marge Bot

parent
e331fd7fc4
commit
0b30336906
@@ -127,9 +127,10 @@ v3d33_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
|
|||||||
/* Limit the number of channels returned to both how many the NIR
|
/* Limit the number of channels returned to both how many the NIR
|
||||||
* instruction writes and how many the instruction could produce.
|
* instruction writes and how many the instruction could produce.
|
||||||
*/
|
*/
|
||||||
assert(instr->dest.is_ssa);
|
|
||||||
p1_unpacked.return_words_of_texture_data =
|
p1_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;
|
||||||
|
|
||||||
uint32_t p0_packed;
|
uint32_t p0_packed;
|
||||||
V3D33_TEXTURE_UNIFORM_PARAMETER_0_CFG_MODE1_pack(NULL,
|
V3D33_TEXTURE_UNIFORM_PARAMETER_0_CFG_MODE1_pack(NULL,
|
||||||
|
@@ -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
|
/* Limit the number of channels returned to both how many the NIR
|
||||||
* instruction writes and how many the instruction could produce.
|
* instruction writes and how many the instruction could produce.
|
||||||
*/
|
*/
|
||||||
assert(instr->dest.is_ssa);
|
|
||||||
p0_unpacked.return_words_of_texture_data =
|
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);
|
assert(p0_unpacked.return_words_of_texture_data != 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user