[Mesa-dev] [PATCH 3/6] panfrost: Control texop value earlier
Boris Brezillon
boris.brezillon at collabora.com
Mon Jun 17 10:49:25 UTC 2019
Right now the failure happens when building the midgard texture
instruction. Since we're about to add support for texop_txs (texture
size) which is does not involve the creation of a texture instruction,
let's add a instr->op check at the beginning of the emit_tex() function
so we can easily branch to a different path when needed.
Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
src/gallium/drivers/panfrost/midgard/midgard_compile.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index 1374c1ee6475..28aad38cc984 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1333,6 +1333,14 @@ emit_tex(compiler_context *ctx, nir_tex_instr *instr)
/* TODO */
//assert (!instr->sampler);
//assert (!instr->texture_array_size);
+ switch (instr->op) {
+ case nir_texop_tex:
+ case nir_texop_txb:
+ case nir_texop_txl:
+ break;
+ default:
+ unreachable("Unhanlded texture op");
+ }
/* Allocate registers via a round robin scheme to alternate between the two registers */
int reg = ctx->texture_op_count & 1;
--
2.20.1
More information about the mesa-dev
mailing list