aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorGregory Mitrano <gregory.mitrano@gmail.com>2016-09-18 23:48:29 -0400
committerGregory Mitrano <gregory.mitrano@gmail.com>2016-09-18 23:48:29 -0400
commita46068a913156ee0eec7219cedcbe2c365d7bcb2 (patch)
treebc7ab4ef95e875d1b006e1d0dc209cd21a21e093 /layers/core_validation.cpp
parentafdb859af77403be5734bad499339855aa9dfd94 (diff)
downloadusermoji-a46068a913156ee0eec7219cedcbe2c365d7bcb2.tar.xz
GH-951 Fixed consistency issue with mip size calculations
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 1ef4f70d..9db7238e 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<float>(1 << mip));
VkExtent3D extent = img->createInfo.extent;
- extent.width = std::max(1U, static_cast<uint32_t>(std::floor(extent.width * reciprocal)));
- extent.height = std::max(1U, static_cast<uint32_t>(std::floor(extent.height * reciprocal)));
- extent.depth = std::max(1U, static_cast<uint32_t>(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;
}