Mesa (master): pan/bi: Add texture indices to IR

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 1 00:49:38 UTC 2020


Module: Mesa
Branch: master
Commit: fc634dc3b2792bd84acb0f5aafd83863ac3c4528
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc634dc3b2792bd84acb0f5aafd83863ac3c4528

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Apr 30 16:08:01 2020 -0400

pan/bi: Add texture indices to IR

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4844>

---

 src/panfrost/bifrost/bi_print.c | 13 +++++++++++--
 src/panfrost/bifrost/compiler.h |  7 +++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c
index f1e42db26d2..08237b6354d 100644
--- a/src/panfrost/bifrost/bi_print.c
+++ b/src/panfrost/bifrost/bi_print.c
@@ -319,6 +319,13 @@ bi_print_branch(struct bi_branch *branch, FILE *fp)
         fprintf(fp, ".%s", bi_cond_name(branch->cond));
 }
 
+static void
+bi_print_texture(struct bi_texture *tex, FILE *fp)
+{
+        fprintf(fp, " - texture %u, sampler %u",
+                        tex->texture_index, tex->sampler_index);
+}
+
 void
 bi_print_instruction(bi_instruction *ins, FILE *fp)
 {
@@ -350,9 +357,9 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
                 fprintf(fp, ".%s", bi_cond_name(ins->cond));
         else if (ins->type == BI_BLEND)
                 fprintf(fp, ".loc%u", ins->blend_location);
-        else if (ins->type == BI_TEX)
+        else if (ins->type == BI_TEX) {
                 fprintf(fp, ".%s", bi_tex_op_name(ins->op.texture));
-        else if (ins->type == BI_BITWISE)
+        } else if (ins->type == BI_BITWISE)
                 fprintf(fp, ".%cshift", ins->bitwise.rshift ? 'r' : 'l');
 
         if (ins->vector_channels)
@@ -393,6 +400,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
                         fprintf(fp, "-> block%u", ins->branch.target->base.name);
                 else
                         fprintf(fp, "-> blockhole");
+        } else if (ins->type == BI_TEX) {
+                bi_print_texture(&ins->texture, fp);
         }
 
         fprintf(fp, "\n");
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 97761643966..f33595dfe40 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -219,6 +219,12 @@ struct bi_bitwise {
         bool rshift; /* false for lshift */
 };
 
+struct bi_texture {
+        /* Constant indices. Indirect would need to be in src[..] like normal,
+         * we can reserve some sentinels there for that for future. */
+        unsigned texture_index, sampler_index;
+};
+
 typedef struct {
         struct list_head link; /* Must be first */
         enum bi_class type;
@@ -297,6 +303,7 @@ typedef struct {
                 unsigned blend_location;
 
                 struct bi_bitwise bitwise;
+                struct bi_texture texture;
         };
 } bi_instruction;
 



More information about the mesa-commit mailing list