From b56be4c37ece4c6cd9a30e6c5bc6f2474194fc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Tue, 17 Jan 2023 13:16:12 +0100 Subject: [PATCH] broadcom/compiler: treat PIPE_FORMAT_NONE as 32-bit formats for output type Needed to support Vulkan feature shaderStorageImageReadWithoutFormat. With that enabled we could receive a NONE format on a load image. For those we treat them as 32-bit formats, that would mean that the lowering would not need to do any format-specific unpacking. Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/compiler/v3d_nir_lower_image_load_store.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/broadcom/compiler/v3d_nir_lower_image_load_store.c b/src/broadcom/compiler/v3d_nir_lower_image_load_store.c index 75bc409c70f..731239896fa 100644 --- a/src/broadcom/compiler/v3d_nir_lower_image_load_store.c +++ b/src/broadcom/compiler/v3d_nir_lower_image_load_store.c @@ -43,6 +43,13 @@ bool v3d_gl_format_is_return_32(enum pipe_format format) { + /* We can get a NONE format in Vulkan because we support the + * shaderStorageImageReadWithoutFormat feature. We consider these to + * always use 32-bit precision. + */ + if (format == PIPE_FORMAT_NONE) + return true; + const struct util_format_description *desc = util_format_description(format); const struct util_format_channel_description *chan = &desc->channel[0];