1032{
1034 return std::nullopt;
1035 }
1036
1038 ||
image->get_depth() != 1 ||
image->get_array_layers() != 1) {
1039 return std::nullopt;
1040 }
1041
1042 if (!
static_cast<bool>(
image->get_usage_flags() & required_usage)) {
1043 return std::nullopt;
1044 }
1045
1046 const auto aspects =
image->get_aspect_flags();
1047 if (static_cast<bool>(aspects & vk::ImageAspectFlagBits::eDepth)
1048 && static_cast<bool>(aspects & vk::ImageAspectFlagBits::eStencil)) {
1049 return std::nullopt;
1050 }
1051
1054 return std::nullopt;
1055 }
1056
1058 if (byte_count == 0 || byte_count >
image->get_size_bytes()) {
1059 return std::nullopt;
1060 }
1061
1063}
static size_t calculate_image_size(uint32_t width, uint32_t height, uint32_t depth, ImageFormat format)
Calculate image data size.
static std::optional< ImageFormat > from_vulkan_format(vk::Format vk_format)
Convert Vulkan format to Portal ImageFormat.