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>
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;
}