v3dv: fix swap_rb and channel_reverse flags in image views
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 5 Sep 2022 11:18:39 +0000 (13:18 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 6 Sep 2022 06:33:38 +0000 (06:33 +0000)
We were computing these from the final swizzle resulting from
combining the format swizzle and the view swizzle, but here we
want to use the format swizzle alone, which is the one we
use to define these properties in the format table.

Fixes CTS test fails with EXT_border_color_swizzle.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18416>

src/broadcom/vulkan/v3dv_image.c

index 1504fc1..ebf2432 100644 (file)
@@ -571,8 +571,8 @@ create_image_view(struct v3dv_device *device,
    util_format_compose_swizzles(format_swizzle, image_view_swizzle,
                                 iview->swizzle);
 
-   iview->swap_rb = v3dv_format_swizzle_needs_rb_swap(iview->swizzle);
-   iview->channel_reverse = v3dv_format_swizzle_needs_reverse(iview->swizzle);
+   iview->swap_rb = v3dv_format_swizzle_needs_rb_swap(format_swizzle);
+   iview->channel_reverse = v3dv_format_swizzle_needs_reverse(format_swizzle);
 
    v3dv_X(device, pack_texture_shader_state)(device, iview);