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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Alejandro Piñeiro 2020-07-01 17:03:28 +02:00 committed by Marge Bot
parent cb1e492ee0
commit 336d9e187c
1 changed files with 6 additions and 0 deletions

View File

@ -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;