summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2021-09-06 01:12:52 +0200
committerMarge Bot <emma+marge@anholt.net>2021-12-03 15:32:36 +0000
commit982c630cd500bd2ad24db9dbc2c5b8fd489350d4 (patch)
tree71da1a7461559e8f36d36d0657e60614ef8e7f5e
parentbb8285c25859b35d06ccd283d7fdf1bab07dc059 (diff)
v3d: restrict formats supported for PIPE_BIND_SHADER_IMAGE
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 <apinheiro@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>
-rw-r--r--src/gallium/drivers/v3d/v3d_screen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
index 1c72dc4af0d..69aa82484e7 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;
}