Flutter Engine
The Flutter Engine
|
Abstract base class that represents a vkImage and an vkImageView. More...
#include <texture_source_vk.h>
Public Member Functions | |
virtual | ~TextureSourceVK () |
const TextureDescriptor & | GetTextureDescriptor () const |
Gets the texture descriptor for this image source. More... | |
virtual vk::Image | GetImage () const =0 |
Get the image handle for this texture source. More... | |
virtual vk::ImageView | GetImageView () const =0 |
Retrieve the image view used for sampling/blitting/compute with this texture source. More... | |
virtual vk::ImageView | GetRenderTargetView () const =0 |
Retrieve the image view used for render target attachments with this texture source. More... | |
fml::Status | SetLayout (const BarrierVK &barrier) const |
Encodes the layout transition barrier to barrier.cmd_buffer for the image. More... | |
vk::ImageLayout | SetLayoutWithoutEncoding (vk::ImageLayout layout) const |
Store the layout of the image. More... | |
vk::ImageLayout | GetLayout () const |
Get the last layout assigned to the TextureSourceVK. More... | |
virtual std::shared_ptr< YUVConversionVK > | GetYUVConversion () const |
When sampling from textures whose formats are not known to Vulkan, a custom conversion is necessary to setup custom samplers. This accessor provides this conversion if one is present. Most texture source have none. More... | |
virtual bool | IsSwapchainImage () const =0 |
Determines if swapchain image. That is, an image used as the root render target. More... | |
void | SetCachedFramebuffer (const SharedHandleVK< vk::Framebuffer > &framebuffer) |
void | SetCachedRenderPass (const SharedHandleVK< vk::RenderPass > &render_pass) |
SharedHandleVK< vk::Framebuffer > | GetCachedFramebuffer () const |
SharedHandleVK< vk::RenderPass > | GetCachedRenderPass () const |
Protected Member Functions | |
TextureSourceVK (TextureDescriptor desc) | |
Protected Attributes | |
const TextureDescriptor | desc_ |
Abstract base class that represents a vkImage and an vkImageView.
This is intended to be used with an impeller::TextureVK. Example implementations represent swapchain images, uploaded textures, Android Hardware Buffer backend textures, etc...
Definition at line 28 of file texture_source_vk.h.
|
virtualdefault |
|
explicitprotected |
Definition at line 9 of file texture_source_vk.cc.
SharedHandleVK< vk::Framebuffer > impeller::TextureSourceVK::GetCachedFramebuffer | ( | ) | const |
Retrieve the last framebuffer object used with this texture.
May be nullptr if no previous framebuffer existed.
Definition at line 75 of file texture_source_vk.cc.
SharedHandleVK< vk::RenderPass > impeller::TextureSourceVK::GetCachedRenderPass | ( | ) | const |
Retrieve the last render pass object used with this texture.
May be nullptr if no previous render pass existed.
Definition at line 79 of file texture_source_vk.cc.
|
pure virtual |
Get the image handle for this texture source.
Implemented in impeller::AllocatedTextureSourceVK, impeller::AHBTextureSourceVK, and impeller::KHRSwapchainImageVK.
|
pure virtual |
Retrieve the image view used for sampling/blitting/compute with this texture source.
Implemented in impeller::AllocatedTextureSourceVK, impeller::AHBTextureSourceVK, and impeller::KHRSwapchainImageVK.
vk::ImageLayout impeller::TextureSourceVK::GetLayout | ( | ) | const |
Get the last layout assigned to the TextureSourceVK.
This value is synchronized with the GPU via SetLayout so it may not reflect the actual layout.
Definition at line 21 of file texture_source_vk.cc.
|
pure virtual |
Retrieve the image view used for render target attachments with this texture source.
ImageViews used as render target attachments cannot have any mip levels. In cases where we want to generate mipmaps with the result of this texture, we need to create multiple image views.
Implemented in impeller::AllocatedTextureSourceVK, impeller::AHBTextureSourceVK, and impeller::KHRSwapchainImageVK.
const TextureDescriptor & impeller::TextureSourceVK::GetTextureDescriptor | ( | ) | const |
Gets the texture descriptor for this image source.
Definition at line 13 of file texture_source_vk.cc.
|
virtual |
When sampling from textures whose formats are not known to Vulkan, a custom conversion is necessary to setup custom samplers. This accessor provides this conversion if one is present. Most texture source have none.
Reimplemented in impeller::AHBTextureSourceVK.
Definition at line 17 of file texture_source_vk.cc.
|
pure virtual |
Determines if swapchain image. That is, an image used as the root render target.
Implemented in impeller::AllocatedTextureSourceVK, impeller::AHBTextureSourceVK, and impeller::KHRSwapchainImageVK.
void impeller::TextureSourceVK::SetCachedFramebuffer | ( | const SharedHandleVK< vk::Framebuffer > & | framebuffer | ) |
Store the last framebuffer object used with this texture.
This field is only set if this texture is used as the resolve texture of a render pass. By construction, this framebuffer should be compatible with any future render passes.
Definition at line 65 of file texture_source_vk.cc.
void impeller::TextureSourceVK::SetCachedRenderPass | ( | const SharedHandleVK< vk::RenderPass > & | render_pass | ) |
Store the last render pass object used with this texture.
This field is only set if this texture is used as the resolve texture of a render pass. By construction, this framebuffer should be compatible with any future render passes.
Definition at line 70 of file texture_source_vk.cc.
fml::Status impeller::TextureSourceVK::SetLayout | ( | const BarrierVK & | barrier | ) | const |
Encodes the layout transition barrier
to barrier.cmd_buffer
for the image.
The transition is from the layout stored via SetLayoutWithoutEncoding
to barrier.new_layout
.
[in] | barrier | The barrier. |
Definition at line 34 of file texture_source_vk.cc.
vk::ImageLayout impeller::TextureSourceVK::SetLayoutWithoutEncoding | ( | vk::ImageLayout | layout | ) | const |
Store the layout of the image.
This just is bookkeeping on the CPU, to actually set the layout use `SetLayout`.
[in] | layout | The new layout. |
Definition at line 26 of file texture_source_vk.cc.
|
protected |
Definition at line 155 of file texture_source_vk.h.