[Mesa-dev] [PATCH 2/6] panfrost/midgard: Implement txl

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Tue Jun 11 17:53:24 UTC 2019


This follows the txb implementation, but requires an adjustment to how
the cont/last flags are set.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
 src/gallium/drivers/panfrost/midgard/midgard_compile.c | 10 +++++-----
 src/gallium/drivers/panfrost/midgard/midgard_emit.c    |  9 ++++++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index 7dc6530afec..5ccb2ef4837 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1309,6 +1309,8 @@ midgard_tex_op(nir_texop op)
                 case nir_texop_tex:
                 case nir_texop_txb:
                         return TEXTURE_OP_NORMAL;
+                case nir_texop_txl:
+                        return TEXTURE_OP_LOD;
                 default:
                         unreachable("Unhanlded texture op");
         }
@@ -1368,7 +1370,8 @@ emit_tex(compiler_context *ctx, nir_tex_instr *instr)
                         break;
                 }
 
-                case nir_tex_src_bias: {
+                case nir_tex_src_bias:
+                case nir_tex_src_lod: {
                         /* To keep RA simple, we put the bias/LOD into the w
                          * component of the input source, which is otherwise in xy */
 
@@ -1408,9 +1411,6 @@ emit_tex(compiler_context *ctx, nir_tex_instr *instr)
 
                         /* Always 1 */
                         .unknown7 = 1,
-
-                        /* Assume we can continue; hint it out later */
-                        .cont = 1,
                 }
         };
 
@@ -1421,7 +1421,7 @@ emit_tex(compiler_context *ctx, nir_tex_instr *instr)
         /* Setup bias/LOD if necessary. Only register mode support right now.
          * TODO: Immediate mode for performance gains */
 
-        if (instr->op == nir_texop_txb) {
+        if (instr->op == nir_texop_txb || instr->op == nir_texop_txl) {
                 ins.texture.lod_register = true;
 
                 midgard_tex_register_select sel = {
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_emit.c b/src/gallium/drivers/panfrost/midgard/midgard_emit.c
index ffa08735ff0..5ddcee419bf 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_emit.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_emit.c
@@ -214,9 +214,12 @@ emit_binary_bundle(compiler_context *ctx,
 
                 ctx->texture_op_count--;
 
-                if (!ctx->texture_op_count) {
-                        ins->texture.cont = 0;
-                        ins->texture.last = 1;
+                if (ins->texture.op == TEXTURE_OP_NORMAL) {
+                        bool continues = ctx->texture_op_count > 0;
+                        ins->texture.cont = continues;
+                        ins->texture.last = !continues;
+                } else {
+                        ins->texture.cont = ins->texture.last = 1;
                 }
 
                 util_dynarray_append(emission, midgard_texture_word, ins->texture);
-- 
2.20.1



More information about the mesa-dev mailing list