From 982c630cd500bd2ad24db9dbc2c5b8fd489350d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Mon, 6 Sep 2021 01:12:52 +0200 Subject: [PATCH] v3d: restrict formats supported for PIPE_BIND_SHADER_IMAGE MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit So far we were relying on the supported formats filtering when creating images from the user API. But for some other (internal) uses, some of the formats that pass the filter need to be restricted when binding them as shader images, as they are not supported for this case. v3 (Iago): - Change commit message. Signed-off-by: Alejandro Piñeiro Signed-off-by: Juan A. Suarez Romero Reviewed-by: Iago Toral Quiroga Part-of: --- src/gallium/drivers/v3d/v3d_screen.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index 1c72dc4..69aa824 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -652,6 +652,23 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen, return false; } + if (usage & PIPE_BIND_SHADER_IMAGE) { + switch (format) { + /* FIXME: maybe we can implement a swizzle-on-writes to add + * support for BGRA-alike formats. + */ + case PIPE_FORMAT_A4B4G4R4_UNORM: + case PIPE_FORMAT_A1B5G5R5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z16_UNORM: + return false; + default: + return true; + } + } + return true; } -- 2.7.4