Flutter Impeller
impeller::TextureVK Class Referencefinal

#include <texture_vk.h>

Inheritance diagram for impeller::TextureVK:
impeller::Texture impeller::BackendCast< TextureVK, Texture >

Public Member Functions

 TextureVK (std::weak_ptr< Context > context, std::shared_ptr< TextureSourceVK > source)
 
 ~TextureVK () override
 
vk::Image GetImage () const
 
vk::ImageView GetImageView () const
 
vk::ImageView GetRenderTargetView () const
 
bool SetLayout (const BarrierVK &barrier) const
 
vk::ImageLayout SetLayoutWithoutEncoding (vk::ImageLayout layout) const
 
vk::ImageLayout GetLayout () const
 
std::shared_ptr< const TextureSourceVKGetTextureSource () const
 
ISize GetSize () const override
 
void SetMipMapGenerated ()
 
bool IsSwapchainImage () const
 
std::shared_ptr< SamplerVKGetImmutableSamplerVariant (const SamplerVK &sampler) const
 
void SetCachedFrameData (const FramebufferAndRenderPass &data, SampleCount sample_count)
 
const FramebufferAndRenderPassGetCachedFrameData (SampleCount sample_count) const
 
- Public Member Functions inherited from impeller::Texture
virtual ~Texture ()
 
bool SetContents (const uint8_t *contents, size_t length, size_t slice=0, bool is_opaque=false)
 
bool SetContents (std::shared_ptr< const fml::Mapping > mapping, size_t slice=0, bool is_opaque=false)
 
bool IsOpaque () const
 
size_t GetMipCount () const
 
const TextureDescriptorGetTextureDescriptor () const
 
void SetCoordinateSystem (TextureCoordinateSystem coordinate_system)
 
TextureCoordinateSystem GetCoordinateSystem () const
 
virtual Scalar GetYCoordScale () const
 
bool NeedsMipmapGeneration () const
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::BackendCast< TextureVK, Texture >
static TextureVKCast (Texture &base)
 
static const TextureVKCast (const Texture &base)
 
static TextureVKCast (Texture *base)
 
static const TextureVKCast (const Texture *base)
 
- Protected Member Functions inherited from impeller::Texture
 Texture (TextureDescriptor desc)
 
- Protected Attributes inherited from impeller::Texture
bool mipmap_generated_ = false
 

Detailed Description

Definition at line 20 of file texture_vk.h.

Constructor & Destructor Documentation

◆ TextureVK()

impeller::TextureVK::TextureVK ( std::weak_ptr< Context context,
std::shared_ptr< TextureSourceVK source 
)

Definition at line 15 of file texture_vk.cc.

17  : Texture(source->GetTextureDescriptor()),
18  context_(std::move(context)),
19  source_(std::move(source)) {
20 #ifdef IMPELLER_DEBUG
21  has_validation_layers_ = HasValidationLayers();
22 #endif // IMPELLER_DEBUG
23 }
Texture(TextureDescriptor desc)
Definition: texture.cc:11
bool HasValidationLayers()
Definition: context_vk.cc:53

References impeller::HasValidationLayers().

◆ ~TextureVK()

impeller::TextureVK::~TextureVK ( )
overridedefault

Member Function Documentation

◆ GetCachedFrameData()

const FramebufferAndRenderPass & impeller::TextureVK::GetCachedFrameData ( SampleCount  sample_count) const

Retrieve the last framebuffer and render pass object used with this texture.

An empty FramebufferAndRenderPass is returned if there is no cached data for a particular sample count.

Definition at line 205 of file texture_vk.cc.

206  {
207  return source_->GetCachedFrameData(sample_count);
208 }

Referenced by impeller::testing::TEST_P().

◆ GetImage()

vk::Image impeller::TextureVK::GetImage ( ) const

Definition at line 170 of file texture_vk.cc.

170  {
171  return source_->GetImage();
172 }

◆ GetImageView()

vk::ImageView impeller::TextureVK::GetImageView ( ) const

Definition at line 174 of file texture_vk.cc.

174  {
175  return source_->GetImageView();
176 }

◆ GetImmutableSamplerVariant()

std::shared_ptr< SamplerVK > impeller::TextureVK::GetImmutableSamplerVariant ( const SamplerVK sampler) const

Definition at line 218 of file texture_vk.cc.

219  {
220  if (!source_) {
221  return nullptr;
222  }
223  std::shared_ptr<YUVConversionVK> conversion = source_->GetYUVConversion();
224  if (!conversion) {
225  // Most textures don't need a sampler conversion and will go down this path.
226  // Only needed for YUV sampling from external textures.
227  return nullptr;
228  }
229  return sampler.CreateVariantForConversion(std::move(conversion));
230 }

References impeller::SamplerVK::CreateVariantForConversion().

◆ GetLayout()

vk::ImageLayout impeller::TextureVK::GetLayout ( ) const

Definition at line 192 of file texture_vk.cc.

192  {
193  return source_ ? source_->GetLayout() : vk::ImageLayout::eUndefined;
194 }

◆ GetRenderTargetView()

vk::ImageView impeller::TextureVK::GetRenderTargetView ( ) const

Definition at line 196 of file texture_vk.cc.

196  {
197  return source_->GetRenderTargetView();
198 }

◆ GetSize()

ISize impeller::TextureVK::GetSize ( ) const
overridevirtual

Implements impeller::Texture.

Definition at line 166 of file texture_vk.cc.

166  {
167  return GetTextureDescriptor().size;
168 }
const TextureDescriptor & GetTextureDescriptor() const
Definition: texture.cc:57

References impeller::Texture::GetTextureDescriptor(), and impeller::TextureDescriptor::size.

◆ GetTextureSource()

std::shared_ptr< const TextureSourceVK > impeller::TextureVK::GetTextureSource ( ) const

Definition at line 178 of file texture_vk.cc.

178  {
179  return source_;
180 }

◆ IsSwapchainImage()

bool impeller::TextureVK::IsSwapchainImage ( ) const

Definition at line 214 of file texture_vk.cc.

214  {
215  return source_->IsSwapchainImage();
216 }

◆ SetCachedFrameData()

void impeller::TextureVK::SetCachedFrameData ( const FramebufferAndRenderPass data,
SampleCount  sample_count 
)

Store the last framebuffer and render pass object used with this texture.

This method is only called 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 200 of file texture_vk.cc.

201  {
202  source_->SetCachedFrameData(data, sample_count);
203 }
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:68

References data.

◆ SetLayout()

bool impeller::TextureVK::SetLayout ( const BarrierVK barrier) const

Definition at line 182 of file texture_vk.cc.

182  {
183  return source_ ? source_->SetLayout(barrier).ok() : false;
184 }

◆ SetLayoutWithoutEncoding()

vk::ImageLayout impeller::TextureVK::SetLayoutWithoutEncoding ( vk::ImageLayout  layout) const

Definition at line 186 of file texture_vk.cc.

187  {
188  return source_ ? source_->SetLayoutWithoutEncoding(layout)
189  : vk::ImageLayout::eUndefined;
190 }

◆ SetMipMapGenerated()

void impeller::TextureVK::SetMipMapGenerated ( )

Definition at line 210 of file texture_vk.cc.

210  {
211  mipmap_generated_ = true;
212 }
bool mipmap_generated_
Definition: texture.h:79

References impeller::Texture::mipmap_generated_.


The documentation for this class was generated from the following files: