16 const VkImageViewCreateInfo createInfo{
17 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
20 static_cast<VkImage
>(
_image),
23 {VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A},
34 VkImageView vkImageView{VK_NULL_HANDLE};
35 VkResult result = vkCreateImageView(static_cast<VkDevice>(
_device), &createInfo,
nullptr, &vkImageView);
38 *returnResult = result;
41 if (result != VK_SUCCESS) {
51 std::unique_ptr<API::ImageView> imageView = std::make_unique<API::ImageView>();
52 return build(*imageView, returnResult) ? std::move(imageView) :
nullptr;
bool build(API::ImageView &instance, VkResult *returnResult=nullptr)
ImageView(const API::Device &device, const API::Image &image)
const API::Device & _device
VkImageViewType _viewType
VkImageAspectFlags _aspectFlags
const API::Image & _image