panfrost/midgard: Differentiate vertex/fragment texture tags
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 11 Jun 2019 17:24:57 +0000 (10:24 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 12 Jun 2019 21:32:12 +0000 (14:32 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/midgard/helpers.h
src/gallium/drivers/panfrost/midgard/midgard_emit.c
src/gallium/drivers/panfrost/midgard/midgard_schedule.c

index b6ab3c86c97226cd8d2fddfd1a302c4af7b7e310..a2cc7e67eafe09c7490e2136f20b31d80b53403d 100644 (file)
@@ -86,6 +86,7 @@
 
 /* 4-bit type tags */
 
+#define TAG_TEXTURE_4_VTX 0x2
 #define TAG_TEXTURE_4 0x3
 #define TAG_LOAD_STORE_4 0x5
 #define TAG_ALU_4 0x8
@@ -100,6 +101,7 @@ quadword_size(int tag)
         case TAG_ALU_4:
         case TAG_LOAD_STORE_4:
         case TAG_TEXTURE_4:
+        case TAG_TEXTURE_4_VTX:
                 return 1;
         case TAG_ALU_8:
                 return 2;
index 5ddcee419bfa2246924aab8c3f1a8ff6a4dd886e..bf6ee4508f59ed8d4beae7056b1bec19408e44ce 100644 (file)
@@ -203,13 +203,15 @@ emit_binary_bundle(compiler_context *ctx,
                 break;
         }
 
-        case TAG_TEXTURE_4: {
+        case TAG_TEXTURE_4:
+        case TAG_TEXTURE_4_VTX: {
                 /* Texture instructions are easy, since there is no pipelining
-                 * nor VLIW to worry about. We may need to set .last flag */
+                 * nor VLIW to worry about. We may need to set .cont/.last
+                 * flags. */
 
                 midgard_instruction *ins = bundle->instructions[0];
 
-                ins->texture.type = TAG_TEXTURE_4;
+                ins->texture.type = bundle->tag;
                 ins->texture.next_type = next_tag;
 
                 ctx->texture_op_count--;
index 9d4ce2a97d5679e334565b84fcf96e4e0352a52c..3d6c7f9cf532b174e9f55b555f9436a737e02e8d 100644 (file)
@@ -370,8 +370,15 @@ schedule_bundle(compiler_context *ctx, midgard_block *block, midgard_instruction
                 break;
         }
 
+        case TAG_TEXTURE_4: {
+                /* Which tag we use depends on the shader stage */
+                bool in_frag = ctx->stage == MESA_SHADER_FRAGMENT;
+                bundle.tag = in_frag ? TAG_TEXTURE_4 : TAG_TEXTURE_4_VTX;
+                break;
+        }
+
         default:
-                /* Texture ops default to single-op-per-bundle scheduling */
+                unreachable("Unknown tag");
                 break;
         }