radeonsi: don't do image stores with RGBX, L, LA, I, and SRGB formats
authorMarek Olšák <marek.olsak@amd.com>
Tue, 19 Jul 2022 01:34:03 +0000 (21:34 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 3 Aug 2022 00:57:16 +0000 (00:57 +0000)
The only change in behavior is that RGBX stores now overwrite X, which is
what CB does and it's faster.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17864>

src/gallium/drivers/radeonsi/si_compute_blit.c

index ecc83e9..d5dc197 100644 (file)
@@ -511,6 +511,14 @@ static void si_launch_grid_internal_images(struct si_context *sctx,
           !(images[i].access & SI_IMAGE_ACCESS_DCC_OFF))
          images[i].access |= SI_IMAGE_ACCESS_ALLOW_DCC_STORE;
 
+      /* Simplify the format according to what image stores support. */
+      if (images[i].access & PIPE_IMAGE_ACCESS_WRITE) {
+         images[i].format = util_format_linear(images[i].format); /* SRGB not supported */
+         images[i].format = util_format_luminance_to_red(images[i].format);
+         images[i].format = util_format_intensity_to_red(images[i].format);
+         images[i].format = util_format_rgbx_to_rgba(images[i].format); /* prevent partial writes */
+      }
+
       /* Save the image. */
       util_copy_image_view(&saved_image[i], &sctx->images[PIPE_SHADER_COMPUTE].views[i]);
    }