Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Friends | List of all members
impeller::SamplerLibraryVK Class Referencefinal

#include <sampler_library_vk.h>

Inheritance diagram for impeller::SamplerLibraryVK:
impeller::SamplerLibrary impeller::BackendCast< SamplerLibraryVK, SamplerLibrary >

Public Member Functions

 ~SamplerLibraryVK () override
 
- Public Member Functions inherited from impeller::SamplerLibrary
virtual ~SamplerLibrary ()
 

Private Member Functions

const std::unique_ptr< const Sampler > & GetSampler (SamplerDescriptor descriptor) override
 Retrieve a backend specific sampler object for the given sampler descriptor.
 

Friends

class ContextVK
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::BackendCast< SamplerLibraryVK, SamplerLibrary >
static SamplerLibraryVKCast (SamplerLibrary &base)
 
static const SamplerLibraryVKCast (const SamplerLibrary &base)
 
static SamplerLibraryVKCast (SamplerLibrary *base)
 
static const SamplerLibraryVKCast (const SamplerLibrary *base)
 
- Protected Member Functions inherited from impeller::SamplerLibrary
 SamplerLibrary ()
 

Detailed Description

Definition at line 15 of file sampler_library_vk.h.

Constructor & Destructor Documentation

◆ ~SamplerLibraryVK()

impeller::SamplerLibraryVK::~SamplerLibraryVK ( )
overridedefault

Member Function Documentation

◆ GetSampler()

const std::unique_ptr< const Sampler > & impeller::SamplerLibraryVK::GetSampler ( SamplerDescriptor  descriptor)
overrideprivatevirtual

Retrieve a backend specific sampler object for the given sampler descriptor.

If the descriptor is invalid or there is a loss of rendering context, this method may return a nullptr.

The sampler library implementations must cache this sampler object and guarantee that the reference will continue to be valid throughout the lifetime of the Impeller context.

Implements impeller::SamplerLibrary.

Definition at line 21 of file sampler_library_vk.cc.

22 {
23 auto found = samplers_.find(desc);
24 if (found != samplers_.end()) {
25 return found->second;
26 }
27 auto device_holder = device_holder_.lock();
28 if (!device_holder || !device_holder->GetDevice()) {
29 return kNullSampler;
30 }
31 return (samplers_[desc] =
32 std::make_unique<SamplerVK>(device_holder->GetDevice(), desc));
33}
static const std::unique_ptr< const Sampler > kNullSampler

Friends And Related Symbol Documentation

◆ ContextVK

friend class ContextVK
friend

Definition at line 23 of file sampler_library_vk.h.


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