summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-02-24 06:28:39 +0000
committerAlyssa Rosenzweig <[email protected]>2019-02-27 03:56:17 +0000
commit60270c83b5e759e4b5edbe5270fe26d52a3967d0 (patch)
tree7fafe71e47d4e76f0e3260209d40f55ff7bac6a5
parent90fd82c540be991fce3ee2c8df6dea10ab7c9a29 (diff)
panfrost: Identify 4-bit channel texture formats
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/include/panfrost-job.h3
-rw-r--r--src/gallium/drivers/panfrost/pan_format.c2
-rw-r--r--src/gallium/drivers/panfrost/pan_pretty_print.c1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index 1a2ba5529aa..1d738486617 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -294,6 +294,8 @@ struct mali_channel_swizzle {
* bits mean.
*/
+#define MALI_CHANNEL_4 2
+
#define MALI_CHANNEL_8 3
#define MALI_CHANNEL_16 4
@@ -367,6 +369,7 @@ enum mali_format {
MALI_RGB16_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(3) | MALI_CHANNEL_16,
MALI_RGB32_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(3) | MALI_CHANNEL_32,
MALI_RGB32F = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(3) | MALI_CHANNEL_FLOAT,
+ MALI_RGBA4_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_4,
MALI_RGBA8_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_8,
MALI_RGBA16_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_16,
MALI_RGBA32_UNORM = MALI_FORMAT_UNORM | MALI_NR_CHANNELS(4) | MALI_CHANNEL_32,
diff --git a/src/gallium/drivers/panfrost/pan_format.c b/src/gallium/drivers/panfrost/pan_format.c
index b81206412ae..cac8a3d0859 100644
--- a/src/gallium/drivers/panfrost/pan_format.c
+++ b/src/gallium/drivers/panfrost/pan_format.c
@@ -91,6 +91,8 @@ static unsigned
panfrost_translate_channel_width(unsigned size)
{
switch (size) {
+ case 4:
+ return MALI_CHANNEL_4;
case 8:
return MALI_CHANNEL_8;
case 16:
diff --git a/src/gallium/drivers/panfrost/pan_pretty_print.c b/src/gallium/drivers/panfrost/pan_pretty_print.c
index 8d7f38b4b8c..d590f267d1c 100644
--- a/src/gallium/drivers/panfrost/pan_pretty_print.c
+++ b/src/gallium/drivers/panfrost/pan_pretty_print.c
@@ -90,6 +90,7 @@ char *pandecode_format_name(enum mali_format format)
DEFINE_CASE(RGB16_UNORM);
DEFINE_CASE(RGB32_UNORM);
DEFINE_CASE(RGB32F);
+ DEFINE_CASE(RGBA4_UNORM);
DEFINE_CASE(RGBA8_UNORM);
DEFINE_CASE(RGBA16_UNORM);
DEFINE_CASE(RGBA32_UNORM);