return (parms.imageType == VK_IMAGE_TYPE_2D) ? parms.extent.depth : 1u;
}
-inline VkExtent3D getExtent3D(const ImageParms& parms)
+ inline VkImageCreateFlags getCreateFlags(const ImageParms& parms)
+ {
+ return parms.imageType == VK_IMAGE_TYPE_2D && parms.extent.depth % 6 == 0 ?
+ VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT : 0;
+ }
+
+inline VkExtent3D getExtent3D(const ImageParms& parms, deUint32 mipLevel = 0u)
{
- const VkExtent3D extent =
+ const bool isCompressed = isCompressedFormat(parms.format);
+ const deUint32 blockWidth = (isCompressed) ? getBlockWidth(parms.format) : 1u;
+ const deUint32 blockHeight = (isCompressed) ? getBlockHeight(parms.format) : 1u;
+
+ if (isCompressed && mipLevel != 0u)
+ DE_FATAL("Not implemented");
+
+ const VkExtent3D extent =
{
- parms.extent.width,
- parms.extent.height,
+ (parms.extent.width >> mipLevel) * blockWidth,
+ (parms.extent.height >> mipLevel) * blockHeight,
(parms.imageType == VK_IMAGE_TYPE_2D) ? 1u : parms.extent.depth
};
return extent;