[Mesa-dev] [PATCH 9/9] panfrost: Implement missing texture formats
Alyssa Rosenzweig
alyssa at rosenzweig.io
Fri Mar 29 01:53:47 UTC 2019
- Implements RGB565/RGBA5551 formats
- Don't advertise support for flipped RGBA5551 and ETC
Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
src/gallium/drivers/panfrost/pan_format.c | 12 ++++++++++++
src/gallium/drivers/panfrost/pan_screen.c | 6 +++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/panfrost/pan_format.c b/src/gallium/drivers/panfrost/pan_format.c
index cac8a3d0859..cb1c71fca29 100644
--- a/src/gallium/drivers/panfrost/pan_format.c
+++ b/src/gallium/drivers/panfrost/pan_format.c
@@ -182,6 +182,18 @@ panfrost_find_format(const struct util_format_description *desc)
case PIPE_FORMAT_Z32_UNORM:
return MALI_Z32_UNORM;
+ case PIPE_FORMAT_B5G6R5_UNORM:
+ return MALI_RGB565;
+
+ case PIPE_FORMAT_B5G5R5A1_UNORM:
+ return MALI_RGB5_A1_UNORM;
+
+ case PIPE_FORMAT_A1B5G5R5_UNORM:
+ case PIPE_FORMAT_X1B5G5R5_UNORM:
+ /* Not supported - this is backwards from OpenGL! */
+ assert(0);
+ break;
+
default:
/* Fallthrough to default */
break;
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 45569d59535..682eb37f5c7 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -440,6 +440,9 @@ panfrost_is_format_supported( struct pipe_screen *screen,
if (format == PIPE_FORMAT_Z24X8_UNORM || format == PIPE_FORMAT_X8Z24_UNORM)
return FALSE;
+ if (format == PIPE_FORMAT_A1B5G5R5_UNORM || format == PIPE_FORMAT_X1B5G5R5_UNORM)
+ return FALSE;
+
if (bind & PIPE_BIND_RENDER_TARGET) {
/* We don't support rendering into anything but RGBA8 yet. We
* need more formats for spec compliance, but for now, honesty
@@ -467,7 +470,8 @@ panfrost_is_format_supported( struct pipe_screen *screen,
}
if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC ||
- format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
+ format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC ||
+ format_desc->layout == UTIL_FORMAT_LAYOUT_ETC) {
/* Compressed formats not yet hooked up. */
return FALSE;
}
--
2.20.1
More information about the mesa-dev
mailing list