From 0b8300580726a2299815582a33b488b6edd91c19 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 15 Jul 2019 07:12:47 -0700 Subject: [PATCH] panfrost: Advertise more depth/stencil formats Fixes a regression in glmark's shadow/refract scenes. Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_screen.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 2d8ecdf2068..ff67c0b14bc 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -388,7 +388,7 @@ panfrost_is_format_supported( struct pipe_screen *screen, return FALSE; /* Format wishlist */ - if (format == PIPE_FORMAT_Z24X8_UNORM || format == PIPE_FORMAT_X8Z24_UNORM) + if (format == PIPE_FORMAT_X8Z24_UNORM) return FALSE; if (format == PIPE_FORMAT_A1B5G5R5_UNORM || format == PIPE_FORMAT_X1B5G5R5_UNORM) @@ -400,8 +400,11 @@ panfrost_is_format_supported( struct pipe_screen *screen, /* Don't confuse poorly written apps (workaround dEQP bug) that expect * more alpha than they ask for */ + bool scanout = bind & (PIPE_BIND_SCANOUT | PIPE_BIND_SHARED | PIPE_BIND_DISPLAY_TARGET); - if (scanout && !util_format_is_rgba8_variant(format_desc)) + bool renderable = bind & PIPE_BIND_RENDER_TARGET; + + if (scanout && renderable && !util_format_is_rgba8_variant(format_desc)) return FALSE; if (format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN && @@ -423,6 +426,8 @@ panfrost_is_format_supported( struct pipe_screen *screen, if (bind & PIPE_BIND_DEPTH_STENCIL) { switch (format) { case PIPE_FORMAT_Z24_UNORM_S8_UINT: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z32_UNORM: return true; default: -- 2.30.2