summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/include/panfrost-job.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-17 14:26:08 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-18 09:59:28 -0700
commit83c02a5ea99cd1c9b196cb79f00e6dda5ffe738c (patch)
treeee49ab242b63c1812cffa5ee5ffd7ce78628ef61 /src/gallium/drivers/panfrost/include/panfrost-job.h
parentbfca21b622dfd2fcfe32494339aea9061070c7e5 (diff)
panfrost: Refactor texture targets
This combines the two cmdstream bits "is_3d" and "is_not_cubemap" into a single 2-bit texture target selection, noticing it's the same as the 2-bit selection in Midgard and Bifrost texturing ops. Accordingly, we share this definition and add the missing entry for 1D/buffer textures. This requires a nontrivial (but functionally similar) refactor of all parts of the driver to use the new definitions appropriately. Theoretically, this should add support for buffer textures, but that's obviously not tested and probably wouldn't work. While doing so, we notice the sRGB enable bit, which we document and decode as well here so we don't forget about it. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/include/panfrost-job.h')
-rw-r--r--src/gallium/drivers/panfrost/include/panfrost-job.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index 12200c373f1..b982b887a47 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -1120,20 +1120,26 @@ enum mali_wrap_mode {
MALI_WRAP_MIRRORED_REPEAT = 0xC
};
+/* Shared across both command stream and Midgard, and even with Bifrost */
+
+enum mali_texture_type {
+ MALI_TEX_CUBE = 0x0,
+ MALI_TEX_1D = 0x1,
+ MALI_TEX_2D = 0x2,
+ MALI_TEX_3D = 0x3
+};
+
/* 8192x8192 */
#define MAX_MIP_LEVELS (13)
/* Cubemap bloats everything up */
-#define MAX_FACES (6)
+#define MAX_CUBE_FACES (6)
/* For each pointer, there is an address and optionally also a stride */
#define MAX_ELEMENTS (2)
/* Corresponds to the type passed to glTexImage2D and so forth */
-/* For usage1 */
-#define MALI_TEX_3D (0x04)
-
/* Flags for usage2 */
#define MALI_TEX_MANUAL_STRIDE (0x20)
@@ -1141,8 +1147,11 @@ struct mali_texture_format {
unsigned swizzle : 12;
enum mali_format format : 8;
- unsigned usage1 : 3;
- unsigned is_not_cubemap : 1;
+ unsigned srgb : 1;
+ unsigned unknown1 : 1;
+
+ enum mali_texture_type type : 2;
+
unsigned usage2 : 8;
} __attribute__((packed));
@@ -1174,7 +1183,7 @@ struct mali_texture_descriptor {
uint32_t unknown6;
uint32_t unknown7;
- mali_ptr payload[MAX_MIP_LEVELS * MAX_FACES * MAX_ELEMENTS];
+ mali_ptr payload[MAX_MIP_LEVELS * MAX_CUBE_FACES * MAX_ELEMENTS];
} __attribute__((packed));
/* Used as part of filter_mode */