radv: fix image view extent override for astc
authorChia-I Wu <olvaffe@gmail.com>
Tue, 7 Nov 2023 21:19:52 +0000 (13:19 -0800)
committerEric Engestrom <eric@engestrom.ch>
Sat, 18 Nov 2023 21:15:10 +0000 (21:15 +0000)
When doing ASTC decoding, the image has format VK_FORMAT_ASTC_*, the
internal plane 1 has format VK_FORMAT_R8G8B8A8_UNORM, and the view has
format VK_FORMAT_R8G8B8A8_UINT.  It does not need the override for
compressed formats.

Fixes: f97b449e9e3 ("radv: integrate meta astc compute decoder to radv")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26106>
(cherry picked from commit 2533d0a0e29cb85e98aaaf44e665e091bf36d980)

.pick_status.json
src/amd/vulkan/radv_image.c

index 93238ee..356f633 100644 (file)
         "description": "radv: fix image view extent override for astc",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "f97b449e9e332026a4b352423f71c6031e5f9e8b",
         "notes": null
index 2ea37d3..2b6c5ea 100644 (file)
@@ -2225,7 +2225,8 @@ radv_image_view_init(struct radv_image_view *iview, struct radv_device *device,
        * block compatible format and the compressed format, so even if we take
        * the plain converted dimensions the physical layout is correct.
        */
-      if (device->physical_device->rad_info.gfx_level >= GFX9 && vk_format_is_block_compressed(image->vk.format) &&
+      if (device->physical_device->rad_info.gfx_level >= GFX9 &&
+          vk_format_is_block_compressed(image->planes[iview->plane_id].format) &&
           !vk_format_is_block_compressed(iview->vk.format)) {
          /* If we have multiple levels in the view we should ideally take the last level,
           * but the mip calculation has a max(..., 1) so walking back to the base mip in an