for (uint32_t r = 0; r < range_count; r++) {
const VkImageSubresourceRange *range = &ranges[r];
-
for (uint32_t l = 0; l < anv_get_levelCount(image, range); ++l) {
- for (uint32_t s = 0; s < anv_get_layerCount(image, range); ++s) {
+ const uint32_t layer_count = image->type == VK_IMAGE_TYPE_3D ?
+ anv_minify(image->extent.depth, l) :
+ anv_get_layerCount(image, range);
+ for (uint32_t s = 0; s < layer_count; ++s) {
struct anv_image_view iview;
anv_image_view_init(&iview, cmd_buffer->device,
&(VkImageViewCreateInfo) {