summaryrefslogtreecommitdiff
path: root/src/panfrost
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2020-11-17 11:25:41 +0100
committerBoris Brezillon <boris.brezillon@collabora.com>2020-11-25 16:22:16 +0100
commit3949e8ba19f70f6e3bbe5453c0f4d8f3f579aca8 (patch)
tree84178405d3e3b4ef662c0b84365ffe363fba64cb /src/panfrost
parent8040b797a821af9b91e1dd6014e596e6f8d9e1a2 (diff)
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 <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index d8aeb727484..7dc5b2c8dc1 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 = {