Mesa (master): turnip: Disable UBWC on images used as storage images.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 21 19:46:05 UTC 2020


Module: Mesa
Branch: master
Commit: d1166a3b3a96845ac2173ef56caee55c9a1ca849
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1166a3b3a96845ac2173ef56caee55c9a1ca849

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jan 15 16:58:21 2020 -0800

turnip: Disable UBWC on images used as storage images.

The closed GL driver doesn't use UBWC on any storage images.  It does tile
mostly (skipping tiling on writeonly images, it seems), but for freedreno
we've been enabling tiling in all cases and it's fine.  We do need to
disable UBWC, as tests fail otherwise and just plugging in the equivalent
UBWC regs like we were setting up a texture isn't enough.

Fixes dEQP-VK.image.atomic_operations.*

Reviewed-by: Jonathan Marek <jonathan at marek.ca>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433>

---

 src/freedreno/vulkan/tu_image.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c
index 978b1b18453..f596feb9855 100644
--- a/src/freedreno/vulkan/tu_image.c
+++ b/src/freedreno/vulkan/tu_image.c
@@ -126,6 +126,18 @@ tu_image_create(VkDevice _device,
       ubwc_enabled = false;
    }
 
+   /* Disable UBWC for storage images.
+    *
+    * The closed GL driver skips UBWC for storage images (and additionally
+    * uses linear for writeonly images).  We seem to have image tiling working
+    * in freedreno in general, so turnip matches that.  freedreno also enables
+    * UBWC on images, but it's not really tested due to the lack of
+    * UBWC-enabled mipmaps in freedreno currently.  Just match the closed GL
+    * behavior of no UBWC.
+   */
+   if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT)
+      ubwc_enabled = false;
+
    uint32_t ubwc_blockwidth, ubwc_blockheight;
    fdl6_get_ubwc_blockwidth(&image->layout,
                             &ubwc_blockwidth, &ubwc_blockheight);



More information about the mesa-commit mailing list