summaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/midgard.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-19 08:10:28 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-21 10:41:15 -0700
commit7f149163720a08634c3b91be119e5a14f8c85bcd (patch)
tree8171c5ff67e5da3bb86bbc0b6a59a7eaa344726b /src/panfrost/midgard/midgard.h
parent8c1bc3c000c2babfc8797ca490b591d6b5feee36 (diff)
pan/midgard: Identify and disassemble indirect texture/sampler
A pair of special flags can turn the texture/sampler handle fields into register selects. This means code like: texture(uTextures[hr28.w], ...) can be compiled to something like: texture ..., fsampler[hr28.w], texture[hr28.w] Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/midgard.h')
-rw-r--r--src/panfrost/midgard/midgard.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h
index 753da1c064e..f1235ec5130 100644
--- a/src/panfrost/midgard/midgard.h
+++ b/src/panfrost/midgard/midgard.h
@@ -628,7 +628,13 @@ __attribute__((__packed__))
unsigned last : 1;
enum mali_texture_type format : 2;
- unsigned zero : 2;
+
+ /* Are sampler_handle/texture_handler respectively set by registers? If
+ * true, the lower 8-bits of the respective field is a register word.
+ * If false, they are an immediate */
+
+ unsigned sampler_register : 1;
+ unsigned texture_register : 1;
/* Is a register used to specify the
* LOD/bias/offset? If set, use the `bias` field as
@@ -693,6 +699,10 @@ __attribute__((__packed__))
unsigned bias : 8;
signed bias_int : 8;
+ /* If sampler/texture_register is set, the bottom 8-bits are
+ * midgard_tex_register_select and the top 8-bits are zero. If they are
+ * clear, they are immediate texture indices */
+
unsigned sampler_handle : 16;
unsigned texture_handle : 16;
}