[Mesa-dev] [PATCH 17/18] panfrost/midgard/disasm: include textureGather()

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Mon Jun 10 22:01:45 UTC 2019


Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
 .../drivers/panfrost/midgard/disassemble.c    | 19 +++++++++++++++----
 .../drivers/panfrost/midgard/midgard.h        |  2 +-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c
index 3c59119e523..743a3d4fe90 100644
--- a/src/gallium/drivers/panfrost/midgard/disassemble.c
+++ b/src/gallium/drivers/panfrost/midgard/disassemble.c
@@ -1048,10 +1048,23 @@ print_texture_format(int format)
 }
 
 static void
-print_texture_op(unsigned op)
+print_texture_op(unsigned op, bool gather)
 {
         /* Act like a bare name, like ESSL functions */
 
+        if (gather) {
+                printf("textureGather");
+
+                unsigned component = op >> 4;
+                unsigned bottom = op & 0xF;
+
+                if (bottom != 0x2)
+                        printf("_unk%d", bottom);
+
+                printf(".%c", components[component]);
+                return;
+        }
+
         switch (op) {
                 DEFINE_CASE(TEXTURE_OP_NORMAL, "texture");
                 DEFINE_CASE(TEXTURE_OP_LOD, "textureLod");
@@ -1081,7 +1094,7 @@ print_texture_word(uint32_t *word, unsigned tabs)
         printf("\n");
 
         /* Broad category of texture operation in question */
-        print_texture_op(texture->op);
+        print_texture_op(texture->op, texture->is_gather);
 
         /* Specific format in question */
         print_texture_format(texture->format);
@@ -1184,12 +1197,10 @@ print_texture_word(uint32_t *word, unsigned tabs)
          * following unknowns are zero, so we don't include them */
 
         if (texture->unknown2 ||
-                        texture->unknown3 ||
                         texture->unknown4 ||
                         texture->unknownA ||
                         texture->unknown8) {
                 printf("// unknown2 = 0x%x\n", texture->unknown2);
-                printf("// unknown3 = 0x%x\n", texture->unknown3);
                 printf("// unknown4 = 0x%x\n", texture->unknown4);
                 printf("// unknownA = 0x%x\n", texture->unknownA);
                 printf("// unknown8 = 0x%x\n", texture->unknown8);
diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h
index c9306230872..fa3e38e0879 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard.h
+++ b/src/gallium/drivers/panfrost/midgard/midgard.h
@@ -510,7 +510,7 @@ __attribute__((__packed__))
 
         unsigned op  : 6;
         unsigned shadow    : 1;
-        unsigned unknown3  : 1;
+        unsigned is_gather  : 1;
 
         /* A little obscure, but last is set for the last texture operation in
          * a shader. cont appears to just be last's opposite (?). Yeah, I know,
-- 
2.20.1



More information about the mesa-dev mailing list