| Flutter Impeller |

Public Member Functions | Friends | List of all members
impeller::YUVConversionLibraryVK Class Reference

Due the way the Vulkan spec. treats "identically defined" conversions, creating two conversion with identical descriptors, using one with the image and the other with the sampler, is invalid use. More...

`#include <yuv_conversion_library_vk.h>`

## Public Member Functions
| ~YUVConversionLibraryVK ()
| YUVConversionLibraryVK (const YUVConversionLibraryVK &)=delete
YUVConversionLibraryVK & | operator= (const YUVConversionLibraryVK &)=delete
std::shared_ptr< YUVConversionVK > | GetConversion (const YUVConversionDescriptorVK &chain)
| Get a conversion for the given descriptor. If there is already a conversion created for an equivalent descriptor, a reference to that descriptor is returned instead. More...

## Friends
class | ContextVK

## Detailed Description

Due the way the Vulkan spec. treats "identically defined" conversions, creating two conversion with identical descriptors, using one with the image and the other with the sampler, is invalid use.

A conversion library hashes and caches identical descriptors to de-duplicate conversions.

There can only be one conversion library (the constructor is private to force this) and it found in the context.

Definition at line 26 of file yuv_conversion_library_vk.h.

## Constructor & Destructor Documentation

## ◆ ~YUVConversionLibraryVK()

impeller::YUVConversionLibraryVK::~YUVConversionLibraryVK | ( |  | ) |
| default

## ◆ YUVConversionLibraryVK()

impeller::YUVConversionLibraryVK::YUVConversionLibraryVK | ( | const YUVConversionLibraryVK & |  | ) |
| delete

## Member Function Documentation

## ◆ GetConversion()

std::shared_ptr< YUVConversionVK > impeller::YUVConversionLibraryVK::GetConversion | ( | const YUVConversionDescriptorVK & | chain | ) |

Get a conversion for the given descriptor. If there is already a conversion created for an equivalent descriptor, a reference to that descriptor is returned instead.

Parameters

  [in] | desc | The descriptor.

Returns
  The conversion. A previously created conversion if one was present and a new one if not. A newly created conversion is cached for subsequent accesses.

Definition at line 18 of file yuv_conversion_library_vk.cc.

19 {
20 Lock lock(conversions_mutex_);
21 auto found = conversions_.find(desc);
22 if (found != conversions_.end()) {
23 return found->second;
24 }
25 auto device_holder = device_holder_.lock();
26 if (!device_holder) {
27 VALIDATION_LOG << "Context loss during creation of YUV conversion.";
28 return nullptr;
29 }
30 return (conversions_[desc] = std::shared_ptr<YUVConversionVK>(
31 new YUVConversionVK(device_holder->GetDevice(), desc)));
32 }

References VALIDATION_LOG.

## ◆ operator=()

YUVConversionLibraryVK& impeller::YUVConversionLibraryVK::operator= | ( | const YUVConversionLibraryVK & |  | ) |
| delete

## Friends And Related Function Documentation

## ◆ ContextVK

friend class ContextVK
| friend

Definition at line 49 of file yuv_conversion_library_vk.h.

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

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

VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91