Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
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 (uint32_t mip_level=0, uint32_t array_layer=0) 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, uint32_t mip_level=0u, uint32_t slice=0u)
 
FramebufferAndRenderPass GetCachedFrameData (SampleCount sample_count, uint32_t mip_level=0u, uint32_t slice=0u) 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
 
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
std::shared_ptr< ContextGLES > context

References impeller::HasValidationLayers().

◆ ~TextureVK()

impeller::TextureVK::~TextureVK ( )
overridedefault

Member Function Documentation

◆ GetCachedFrameData()

FramebufferAndRenderPass impeller::TextureVK::GetCachedFrameData ( SampleCount  sample_count,
uint32_t  mip_level = 0u,
uint32_t  slice = 0u 
) const

Retrieve the cached framebuffer and render pass for the given (sample_count, mip_level, slice) subresource. Returns an empty FramebufferAndRenderPass if no entry exists.

Definition at line 208 of file texture_vk.cc.

210 {
211 return source_->GetCachedFrameData(sample_count, mip_level, slice);
212}

Referenced by impeller::testing::TEST_P(), impeller::testing::TEST_P(), and 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 222 of file texture_vk.cc.

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

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 ( uint32_t  mip_level = 0,
uint32_t  array_layer = 0 
) const

Definition at line 196 of file texture_vk.cc.

197 {
198 return source_->GetRenderTargetView(mip_level, array_layer);
199}

◆ 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:55

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 218 of file texture_vk.cc.

218 {
219 return source_->IsSwapchainImage();
220}

◆ SetCachedFrameData()

void impeller::TextureVK::SetCachedFrameData ( const FramebufferAndRenderPass data,
SampleCount  sample_count,
uint32_t  mip_level = 0u,
uint32_t  slice = 0u 
)

Store the framebuffer and render pass last used to render into the (sample_count, mip_level, slice) subresource of this texture.

Only called when this texture is being used as the resolve (or non-MSAA color) target of a render pass.

Definition at line 201 of file texture_vk.cc.

204 {
205 source_->SetCachedFrameData(data, sample_count, mip_level, slice);
206}

◆ 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 214 of file texture_vk.cc.

214 {
215 mipmap_generated_ = true;
216}
bool mipmap_generated_
Definition texture.h:69

References impeller::Texture::mipmap_generated_.


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