summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-11 10:24:57 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-12 14:32:12 -0700
commit1ee2366693f4c79bbbc600af2b86bec53b9f0638 (patch)
treef6e4aa7a89aa2da257851d13684da2fd291a9077 /src
parent5062b612be79fad82b4f1b4adf4c30824cb6cff8 (diff)
panfrost/midgard: Differentiate vertex/fragment texture tags
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/midgard/helpers.h2
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_emit.c8
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_schedule.c9
3 files changed, 15 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium/drivers/panfrost/midgard/helpers.h
index b6ab3c86c97..a2cc7e67eaf 100644
--- a/src/gallium/drivers/panfrost/midgard/helpers.h
+++ b/src/gallium/drivers/panfrost/midgard/helpers.h
@@ -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;
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_emit.c b/src/gallium/drivers/panfrost/midgard/midgard_emit.c
index 5ddcee419bf..bf6ee4508f5 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_emit.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_emit.c
@@ -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--;
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_schedule.c b/src/gallium/drivers/panfrost/midgard/midgard_schedule.c
index 9d4ce2a97d5..3d6c7f9cf53 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_schedule.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_schedule.c
@@ -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;
}