From a46068a913156ee0eec7219cedcbe2c365d7bcb2 Mon Sep 17 00:00:00 2001 From: Gregory Mitrano Date: Sun, 18 Sep 2016 23:48:29 -0400 Subject: [PATCH] GH-951 Fixed consistency issue with mip size calculations --- layers/core_validation.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 1ef4f70..9db7238 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -7720,11 +7720,10 @@ static inline bool IsExtentEqual(const VkExtent3D *extent, const VkExtent3D *oth // Returns the image extent of a specific subresource. static inline VkExtent3D GetImageSubresourceExtent(const IMAGE_NODE *img, const VkImageSubresourceLayers *subresource) { const uint32_t mip = subresource->mipLevel; - const float reciprocal = (1.0f / static_cast(1 << mip)); VkExtent3D extent = img->createInfo.extent; - extent.width = std::max(1U, static_cast(std::floor(extent.width * reciprocal))); - extent.height = std::max(1U, static_cast(std::floor(extent.height * reciprocal))); - extent.depth = std::max(1U, static_cast(std::floor(extent.depth * reciprocal))); + extent.width = std::max(1U, extent.width >> mip); + extent.height = std::max(1U, extent.height >> mip); + extent.depth = std::max(1U, extent.depth >> mip); return extent; } -- 2.7.4