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 b6ab3c8..a2cc7e6 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 5ddcee4..bf6ee45 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 9d4ce2a..3d6c7f9 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;
         }