v3dv: compute swap_rb flag after applying all swizzles

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 <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7271>
This commit is contained in:
Iago Toral Quiroga
2020-10-22 10:48:22 +02:00
parent 40788be134
commit d8cabe0cbe
+1 -1
View File
@@ -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);