A texture source that wraps an instance of AHardwareBuffer. More...
#include <ahb_texture_source_vk.h>
Public Types | |
| using | AHBProperties = vk::StructureChain< vk::AndroidHardwareBufferPropertiesANDROID, vk::AndroidHardwareBufferFormatPropertiesANDROID > |
| using | ImageViewInfo = vk::StructureChain< vk::ImageViewCreateInfo, vk::SamplerYcbcrConversionInfo > |
Public Member Functions | |
| AHBTextureSourceVK (const std::shared_ptr< Context > &context, struct AHardwareBuffer *hardware_buffer, const AHardwareBuffer_Desc &hardware_buffer_desc) | |
| AHBTextureSourceVK (const std::shared_ptr< Context > &context, std::unique_ptr< android::HardwareBuffer > backing_store, bool is_swapchain_image) | |
| ~AHBTextureSourceVK () override | |
| 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. | |
| vk::ImageView | GetRenderTargetView (uint32_t mip_level, uint32_t array_layer) const override |
| Retrieve the image view used to attach a specific subresource of this texture as a render target. | |
| bool | IsValid () const |
| bool | IsSwapchainImage () const override |
| Determines if swapchain image. That is, an image used as the root render target. | |
| std::shared_ptr< YUVConversionVK > | GetYUVConversion () const override |
| 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. | |
| const android::HardwareBuffer * | GetBackingStore () const |
Public Member Functions inherited from impeller::TextureSourceVK | |
| virtual | ~TextureSourceVK () |
| const TextureDescriptor & | GetTextureDescriptor () const |
| Gets the texture descriptor for this image source. | |
| fml::Status | SetLayout (const BarrierVK &barrier) const |
Encodes the layout transition barrier to barrier.cmd_buffer for the image. | |
| vk::ImageLayout | SetLayoutWithoutEncoding (vk::ImageLayout layout) const |
| Store the layout of the image. | |
| vk::ImageLayout | GetLayout () const |
| Get the last layout assigned to the TextureSourceVK. | |
| void | SetCachedFrameData (const FramebufferAndRenderPass &data, SampleCount sample_count, uint32_t mip_level=0u, uint32_t slice=0u) |
| FramebufferAndRenderPass | GetCachedFrameData (SampleCount sample_count, uint32_t mip_level=0u, uint32_t slice=0u) const |
Static Public Member Functions | |
| static vk::UniqueImage | CreateVKImageWrapperForAndroidHarwareBuffer (const vk::Device &device, const AHBProperties &ahb_props, const AHardwareBuffer_Desc &ahb_desc) |
| Create a VkImage that wraps an Android hardware buffer. | |
| static ImageViewInfo | CreateImageViewInfo (const vk::Image &image, const std::shared_ptr< YUVConversionVK > &yuv_conversion_wrapper, const AHBProperties &ahb_props, const AHardwareBuffer_Desc &ahb_desc) |
Additional Inherited Members | |
Protected Member Functions inherited from impeller::TextureSourceVK | |
| TextureSourceVK (TextureDescriptor desc) | |
Protected Attributes inherited from impeller::TextureSourceVK | |
| const TextureDescriptor | desc_ |
A texture source that wraps an instance of AHardwareBuffer.
The formats and conversions supported by Android Hardware
Buffers are a superset of those supported by Impeller (and
Vulkan for that matter). Impeller and Vulkan descriptors
obtained from the these texture sources are advisory and it
usually isn't possible to create copies of images and image
views held in these texture sources using the inferred
descriptors. The objects are meant to be used directly (either
as render targets or sources for sampling), not copied.
Definition at line 32 of file ahb_texture_source_vk.h.
| using impeller::AHBTextureSourceVK::AHBProperties = vk::StructureChain< vk::AndroidHardwareBufferPropertiesANDROID, vk::AndroidHardwareBufferFormatPropertiesANDROID> |
Definition at line 65 of file ahb_texture_source_vk.h.
| using impeller::AHBTextureSourceVK::ImageViewInfo = vk::StructureChain<vk::ImageViewCreateInfo, vk::SamplerYcbcrConversionInfo> |
Definition at line 71 of file ahb_texture_source_vk.h.
| impeller::AHBTextureSourceVK::AHBTextureSourceVK | ( | const std::shared_ptr< Context > & | context, |
| struct AHardwareBuffer * | hardware_buffer, | ||
| const AHardwareBuffer_Desc & | hardware_buffer_desc | ||
| ) |
Definition at line 193 of file ahb_texture_source_vk.cc.
References impeller::BackendCast< ContextVK, Context >::Cast(), context, CreateImageViewInfo(), CreateVKImageWrapperForAndroidHarwareBuffer(), device, image, physical_device, and VALIDATION_LOG.
| impeller::AHBTextureSourceVK::AHBTextureSourceVK | ( | const std::shared_ptr< Context > & | context, |
| std::unique_ptr< android::HardwareBuffer > | backing_store, | ||
| bool | is_swapchain_image | ||
| ) |
Definition at line 282 of file ahb_texture_source_vk.cc.
|
overridedefault |
|
static |
Create a VkImageViewCreateInfo that matches the properties of an Android hardware buffer.
Definition at line 405 of file ahb_texture_source_vk.cc.
References FlutterVulkanImage::format, image, and impeller::TSize< T >::width.
Referenced by AHBTextureSourceVK(), and impeller::android::testing::TEST().
|
static |
Create a VkImage that wraps an Android hardware buffer.
Definition at line 332 of file ahb_texture_source_vk.cc.
References device, image, VALIDATION_LOG, and impeller::TSize< T >::width.
Referenced by AHBTextureSourceVK(), and impeller::android::testing::TEST().
| const android::HardwareBuffer * impeller::AHBTextureSourceVK::GetBackingStore | ( | ) | const |
Definition at line 328 of file ahb_texture_source_vk.cc.
Referenced by impeller::glvk::CreateEGLImageFromAHBTexture().
|
overridevirtual |
Get the image handle for this texture source.
Implements impeller::TextureSourceVK.
Definition at line 301 of file ahb_texture_source_vk.cc.
|
overridevirtual |
Retrieve the image view used for sampling/blitting/compute with this texture source.
Implements impeller::TextureSourceVK.
Definition at line 306 of file ahb_texture_source_vk.cc.
|
overridevirtual |
Retrieve the image view used to attach a specific subresource of this texture as a render target.
The returned view covers a single mip level and a single array layer (or cube map face), since attachment views cannot span multiple levels or layers.
| [in] | mip_level | The mip level to attach. |
| [in] | array_layer | The array layer or cube map face to attach. |
Implements impeller::TextureSourceVK.
Definition at line 311 of file ahb_texture_source_vk.cc.
|
overridevirtual |
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 from impeller::TextureSourceVK.
Definition at line 324 of file ahb_texture_source_vk.cc.
Referenced by impeller::android::testing::TEST(), and impeller::android::testing::TEST().
|
overridevirtual |
Determines if swapchain image. That is, an image used as the root render target.
Implements impeller::TextureSourceVK.
Definition at line 319 of file ahb_texture_source_vk.cc.
| bool impeller::AHBTextureSourceVK::IsValid | ( | ) | const |
Definition at line 296 of file ahb_texture_source_vk.cc.
Referenced by impeller::android::testing::TEST(), and impeller::android::testing::TEST().