diff --git a/src/broadcom/compiler/v3d33_tex.c b/src/broadcom/compiler/v3d33_tex.c index 488021bfc60..1b24fa0db3c 100644 --- a/src/broadcom/compiler/v3d33_tex.c +++ b/src/broadcom/compiler/v3d33_tex.c @@ -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 * instruction writes and how many the instruction could produce. */ - assert(instr->dest.is_ssa); 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; V3D33_TEXTURE_UNIFORM_PARAMETER_0_CFG_MODE1_pack(NULL, diff --git a/src/broadcom/compiler/v3d40_tex.c b/src/broadcom/compiler/v3d40_tex.c index 931ce759727..7e39f8b5498 100644 --- a/src/broadcom/compiler/v3d40_tex.c +++ b/src/broadcom/compiler/v3d40_tex.c @@ -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);