| 431 | } |
| 432 | |
| 433 | const VkResult VulkanDevice::createImage(VkImage& image, const VkImageType imageType, const uint32_t width, |
| 434 | const uint32_t height, const uint32_t depth, const VkFormat format, VkImageUsageFlags usage, |
| 435 | const VkAllocationCallbacks* allocator) const { |
| 436 | VkImageCreateInfo info = {}; |
| 437 | info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; |
| 438 | info.imageType = imageType; |
| 439 | info.extent.width = width; |
| 440 | info.extent.height = height; |
| 441 | info.extent.depth = depth; |
| 442 | info.mipLevels = 1; |
| 443 | info.arrayLayers = 1; |
| 444 | info.format = format; |
| 445 | info.tiling = VK_IMAGE_TILING_OPTIMAL; |
| 446 | info.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; |
| 447 | info.usage = usage; |
| 448 | info.samples = VK_SAMPLE_COUNT_1_BIT; |
| 449 | info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; |
| 450 | info.pNext = nullptr; |
| 451 | return vkCreateImage(mDevice, &info, allocator, &image); |
| 452 | } |
| 453 | |
| 454 | const void VulkanDevice::destroyImage(const VkImage& image, const VkAllocationCallbacks* allocator) const { |
| 455 | vkDestroyImage(mDevice, image, allocator); |