From: Gregory Mitrano Date: Mon, 19 Sep 2016 03:48:29 +0000 (-0400) Subject: GH-951 Fixed consistency issue with mip size calculations X-Git-Tag: upstream/1.1.92~2541 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a46068a913156ee0eec7219cedcbe2c365d7bcb2;p=platform%2Fupstream%2FVulkan-Tools.git GH-951 Fixed consistency issue with mip size calculations --- 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; }