19 VkSharingMode sharingMode = VK_SHARING_MODE_EXCLUSIVE;
21 if (queueFamilyIndices.size() > 1 && !
_exclusive) {
22 sharingMode = VK_SHARING_MODE_CONCURRENT;
26 if (imageFormat == VK_FORMAT_UNDEFINED) {
27 LUG_LOG.error(
"Image::build: Can't find image format");
32 const VkImageCreateInfo createInfo{
33 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
45 static_cast<uint32_t
>(queueFamilyIndices.size()),
46 queueFamilyIndices.data(),
51 VkImage vkImage{VK_NULL_HANDLE};
52 VkResult result = vkCreateImage(static_cast<VkDevice>(
_device), &createInfo,
nullptr, &vkImage);
55 *returnResult = result;
58 if (result != VK_SUCCESS) {
68 std::unique_ptr<API::Image> image = std::make_unique<API::Image>();
69 return build(*image, returnResult) ? std::move(image) :
nullptr;
std::set< VkFormat > _preferedFormats
const API::Device & _device
Image(const API::Device &device)
VkImageLayout _initialLayout
std::set< uint32_t > _queueFamilyIndices
VkFormatFeatureFlags _featureFlags
VkImageCreateFlags _createFlags
VkSampleCountFlagBits _sampleCount
static VkFormat findSupportedFormat(const Device &device, const std::set< VkFormat > &formats, VkImageTiling tiling, VkFormatFeatureFlags features)
bool build(API::Image &instance, VkResult *returnResult=nullptr)