From 3949e8ba19f70f6e3bbe5453c0f4d8f3f579aca8 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 17 Nov 2020 11:25:41 +0100 Subject: [PATCH] pan/bi: Always emit a LOD/CUBE word for FETCH instructions There's no flag/mode to reflect when a LOD is zero on FETCH instructions, we have to emit the LOD/CUBE word unconditionally. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index d8aeb72..7dc5b2c 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1608,7 +1608,7 @@ bi_emit_lod_cube(bi_context *ctx, unsigned lod) .type = BI_SELECT, .dest = bi_make_temp(ctx), .dest_type = nir_type_int16, - .src = { lod, BIR_INDEX_ZERO }, + .src = { lod ? : BIR_INDEX_ZERO, BIR_INDEX_ZERO }, .src_types = { nir_type_int16, nir_type_int16 }, }; @@ -2058,6 +2058,9 @@ emit_texc(bi_context *ctx, nir_tex_instr *instr) } } + if (desc.op == BIFROST_TEX_OP_FETCH && !dregs[BIFROST_TEX_DREG_LOD]) + dregs[BIFROST_TEX_DREG_LOD] = bi_emit_lod_cube(ctx, 0); + /* Allocate data registers contiguously. Index must not be marked SSA * due to a quirk of RA for tied operands, could be fixed eventually */ bi_instruction combine = { -- 2.7.4