From 336d9e187ce6a4dc6fd9cb8ed9f13b7800d24d1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 1 Jul 2020 17:03:28 +0200 Subject: [PATCH] v3dv/image: fix TEXTURE_SHADER_STATE depth for cube arrays For these we want to divide the number of layers by 6. Fixes: dEQP-VK.pipeline.image_view.view_type.cube_array.* dEQP-VK.pipeline.image.suballocation.sampling_type.combined.view_type.cube_array.* Part-of: --- src/broadcom/vulkan/v3dv_image.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/broadcom/vulkan/v3dv_image.c b/src/broadcom/vulkan/v3dv_image.c index 9db94ff..df752f3 100644 --- a/src/broadcom/vulkan/v3dv_image.c +++ b/src/broadcom/vulkan/v3dv_image.c @@ -477,6 +477,12 @@ pack_texture_shader_state(struct v3dv_device *device, } else { tex.image_depth = (image_view->last_layer - image_view->first_layer) + 1; } + + if (image_view->type == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { + assert(tex.image_depth % 6 == 0); + tex.image_depth /= 6; + } + tex.image_height = image->extent.height * msaa_scale; tex.image_width = image->extent.width * msaa_scale; -- 2.7.4