| Flutter Impeller |

Public Member Functions | List of all members
impeller::SamplerVK Class Referencefinal

`#include <sampler_vk.h>`

Inheritance diagram for impeller::SamplerVK:

## Public Member Functions
| SamplerVK (const vk::Device &device, SamplerDescriptor desc, std::shared_ptr< YUVConversionVK > yuv_conversion={})
| ~SamplerVK () override
vk::Sampler | GetSampler () const
std::shared_ptr< SamplerVK > | CreateVariantForConversion (std::shared_ptr< YUVConversionVK > conversion) const
const std::shared_ptr< YUVConversionVK > & | GetYUVConversion () const
Public Member Functions inherited from impeller::Sampler
virtual | ~Sampler ()
const SamplerDescriptor & | GetDescriptor () const

## Additional Inherited Members
Static Public Member Functions inherited from impeller::BackendCast< SamplerVK, Sampler >
static SamplerVK & | Cast (Sampler &base)
static const SamplerVK & | Cast (const Sampler &base)
static SamplerVK * | Cast (Sampler *base)
static const SamplerVK * | Cast (const Sampler *base)
Protected Member Functions inherited from impeller::Sampler
| Sampler (SamplerDescriptor desc)
Protected Attributes inherited from impeller::Sampler
SamplerDescriptor | desc_

## Detailed Description

Definition at line 18 of file sampler_vk.h.

## Constructor & Destructor Documentation

## ◆ SamplerVK()

impeller::SamplerVK::SamplerVK | ( | const vk::Device & | device,
|  | SamplerDescriptor | desc,
|  | std::shared_ptr< YUVConversionVK > | yuv_conversion = `{}`
| ) |  |

Definition at line 110 of file sampler_vk.cc.

113 : Sampler(std::move(desc)),
114 device_(device),
115 sampler_(MakeSharedVK<vk::Sampler>(
116 CreateSampler(device, desc_, yuv_conversion))),
117 yuv_conversion_(std::move(yuv_conversion)) {
118 is_valid_ = sampler_ && !!sampler_->Get();
119 }

## ◆ ~SamplerVK()

impeller::SamplerVK::~SamplerVK | ( |  | ) |
| override default

## Member Function Documentation

## ◆ CreateVariantForConversion()

std::shared_ptr< SamplerVK > impeller::SamplerVK::CreateVariantForConversion | ( | std::shared_ptr< YUVConversionVK > | conversion | ) | const

Definition at line 127 of file sampler_vk.cc.

128 {
129 if (!conversion || !is_valid_) {
130 return nullptr;
131 }
132 return std::make_shared<SamplerVK>(device_, desc_, std::move(conversion));
133 }

References impeller::Sampler::desc_.

Referenced by impeller::TextureVK::GetImmutableSamplerVariant().

## ◆ GetSampler()

vk::Sampler impeller::SamplerVK::GetSampler | ( |  | ) | const

Definition at line 123 of file sampler_vk.cc.

123 {
124 return *sampler_;
125 }

## ◆ GetYUVConversion()

const std::shared_ptr< YUVConversionVK > & impeller::SamplerVK::GetYUVConversion | ( |  | ) | const

Definition at line 135 of file sampler_vk.cc.

135 {
136 return yuv_conversion_;
137 }

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

- impeller/renderer/backend/vulkan/sampler_vk.h
- impeller/renderer/backend/vulkan/sampler_vk.cc

impeller::Sampler::Sampler
Sampler(SamplerDescriptor desc)
Definition: sampler.cc:9
impeller::CreateSampler
static vk::UniqueSampler CreateSampler(const vk::Device &device, const SamplerDescriptor &desc, const std::shared_ptr< YUVConversionVK > &yuv_conversion)
Definition: sampler_vk.cc:14
impeller::Sampler::desc_
SamplerDescriptor desc_
Definition: sampler.h:22