From e0b3285ae2ec5ee5df606c21604db715c10e7d30 Mon Sep 17 00:00:00 2001 From: siystar Date: Tue, 15 Aug 2023 16:58:59 +0200 Subject: [PATCH] [UPDATED] ImageView to use VK_REMAINING_MIP_LEVELS --- src/vsg/state/ImageInfo.cpp | 1 - src/vsg/state/ImageView.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vsg/state/ImageInfo.cpp b/src/vsg/state/ImageInfo.cpp index 6b9938b39..a04dedf86 100644 --- a/src/vsg/state/ImageInfo.cpp +++ b/src/vsg/state/ImageInfo.cpp @@ -159,7 +159,6 @@ void ImageInfo::computeNumMipMapLevels() } image->mipLevels = mipLevels; - imageView->subresourceRange.levelCount = mipLevels; if (generateMipmaps) image->usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT; } diff --git a/src/vsg/state/ImageView.cpp b/src/vsg/state/ImageView.cpp index 398becabf..46cb0eb4e 100644 --- a/src/vsg/state/ImageView.cpp +++ b/src/vsg/state/ImageView.cpp @@ -62,7 +62,7 @@ ImageView::ImageView(ref_ptr in_image) : format = image->format; subresourceRange.aspectMask = computeAspectFlagsForFormat(image->format); subresourceRange.baseMipLevel = 0; - subresourceRange.levelCount = image->mipLevels; + subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; subresourceRange.baseArrayLayer = 0; subresourceRange.layerCount = image->arrayLayers; } @@ -86,7 +86,7 @@ ImageView::ImageView(ref_ptr in_image, VkImageAspectFlags aspectFlags) : format = image->format; subresourceRange.aspectMask = aspectFlags; subresourceRange.baseMipLevel = 0; - subresourceRange.levelCount = image->mipLevels; + subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; subresourceRange.baseArrayLayer = 0; subresourceRange.layerCount = image->arrayLayers; }