From d8cabe0cbe2d8eb2a2d0abc6cff6717544384d03 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 22 Oct 2020 10:48:22 +0200 Subject: [PATCH] v3dv: compute swap_rb flag after applying all swizzles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were computing this too early based on the view's format alone which is not correct, since we need to consider the view's swizzle as well. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/vulkan/v3dv_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/broadcom/vulkan/v3dv_image.c b/src/broadcom/vulkan/v3dv_image.c index f864180025a..519d3f1626f 100644 --- a/src/broadcom/vulkan/v3dv_image.c +++ b/src/broadcom/vulkan/v3dv_image.c @@ -658,7 +658,6 @@ v3dv_CreateImageView(VkDevice _device, iview->vk_format = format; iview->format = v3dv_get_format(format); assert(iview->format && iview->format->supported); - iview->swap_rb = iview->format->swizzle[0] == PIPE_SWIZZLE_Z; if (vk_format_is_depth_or_stencil(iview->vk_format)) { iview->internal_type = v3dv_get_internal_depth_type(iview->vk_format); @@ -671,6 +670,7 @@ v3dv_CreateImageView(VkDevice _device, const uint8_t *format_swizzle = v3dv_get_format_swizzle(format); util_format_compose_swizzles(format_swizzle, image_view_swizzle, iview->swizzle); + iview->swap_rb = iview->swizzle[0] == PIPE_SWIZZLE_Z; pack_texture_shader_state(device, iview);