13 vk::ImageViewCreateInfo view_info;
14 view_info.image = image_;
15 view_info.viewType = vk::ImageViewType::e2D;
17 view_info.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor;
18 view_info.subresourceRange.baseMipLevel = 0u;
19 view_info.subresourceRange.baseArrayLayer = 0u;
20 view_info.subresourceRange.levelCount =
desc.mip_count;
23 auto [view_result, view] =
device.createImageViewUnique(view_info);
24 if (view_result != vk::Result::eSuccess) {
28 image_view_ = std::move(view);
45 return image_view_.get();
50 return image_view_.get();
KHRSwapchainImageVK(TextureDescriptor desc, const vk::Device &device, vk::Image image)
vk::Image GetImage() const override
Get the image handle for this texture source.
vk::ImageView GetImageView() const override
Retrieve the image view used for sampling/blitting/compute with this texture source.
bool IsSwapchainImage() const override
Determines if swapchain image. That is, an image used as the root render target.
~KHRSwapchainImageVK() override
vk::ImageView GetRenderTargetView() const override
Retrieve the image view used for render target attachments with this texture source.
Abstract base class that represents a vkImage and an vkImageView.
sk_sp< const SkImage > image
constexpr uint32_t ToArrayLayerCount(TextureType type)
constexpr vk::Format ToVKImageFormat(PixelFormat format)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...