Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
skgpu::VulkanYcbcrConversionInfo Struct Reference

#include <VulkanTypes.h>

Public Member Functions

bool operator== (const VulkanYcbcrConversionInfo &that) const
 
bool operator!= (const VulkanYcbcrConversionInfo &that) const
 
bool isValid () const
 
uint32_t nonFormatInfoAsUInt32 () const
 

Public Attributes

VkFormat fFormat = VK_FORMAT_UNDEFINED
 
uint64_t fExternalFormat = 0
 
VkSamplerYcbcrModelConversion fYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY
 
VkSamplerYcbcrRange fYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL
 
VkChromaLocation fXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN
 
VkChromaLocation fYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN
 
VkFilter fChromaFilter = VK_FILTER_NEAREST
 
VkBool32 fForceExplicitReconstruction = false
 
VkFormatFeatureFlags fFormatFeatures = 0
 
VkComponentMapping fComponents
 

Static Public Attributes

static constexpr int kUsesExternalFormatBits = 1
 
static constexpr int kYcbcrModelBits = 3
 
static constexpr int kYcbcrRangeBits = 1
 
static constexpr int kXChromaOffsetBits = 1
 
static constexpr int kYChromaOffsetBits = 1
 
static constexpr int kChromaFilterBits = 1
 
static constexpr int kForceExplicitReconBits = 1
 
static constexpr int kComponentBits = 3
 
static constexpr int kUsesExternalFormatShift = 0
 
static constexpr int kYcbcrModelShift
 
static constexpr int kYcbcrRangeShift = kYcbcrModelShift + kYcbcrModelBits
 
static constexpr int kXChromaOffsetShift = kYcbcrRangeShift + kYcbcrRangeBits
 
static constexpr int kYChromaOffsetShift = kXChromaOffsetShift + kXChromaOffsetBits
 
static constexpr int kChromaFilterShift = kYChromaOffsetShift + kYChromaOffsetBits
 
static constexpr int kForceExplicitReconShift = kChromaFilterShift + kChromaFilterBits
 
static constexpr int kComponentRShift = kForceExplicitReconShift + kComponentBits
 
static constexpr int kComponentGShift = kComponentRShift + kComponentBits
 
static constexpr int kComponentBShift = kComponentGShift + kComponentBits
 
static constexpr int kComponentAShift = kComponentBShift + kComponentBits
 

Detailed Description

Definition at line 62 of file VulkanTypes.h.

Member Function Documentation

◆ isValid()

bool skgpu::VulkanYcbcrConversionInfo::isValid ( ) const
inline

Definition at line 89 of file VulkanTypes.h.

89 {
91 fExternalFormat != 0;
92 }
VkSamplerYcbcrModelConversion fYcbcrModel
@ VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY

◆ nonFormatInfoAsUInt32()

uint32_t skgpu::VulkanYcbcrConversionInfo::nonFormatInfoAsUInt32 ( ) const
inline

Definition at line 94 of file VulkanTypes.h.

94 {
95 static_assert(kComponentAShift + kComponentBits <= 32);
96
107
108 bool usesExternalFormat = fFormat == VK_FORMAT_UNDEFINED;
109
110 return ((static_cast<uint32_t>(usesExternalFormat ) << kUsesExternalFormatShift) |
111 (static_cast<uint32_t>(fYcbcrModel ) << kYcbcrModelShift ) |
112 (static_cast<uint32_t>(fYcbcrRange ) << kYcbcrRangeShift ) |
113 (static_cast<uint32_t>(fXChromaOffset ) << kXChromaOffsetShift ) |
114 (static_cast<uint32_t>(fYChromaOffset ) << kYChromaOffsetShift ) |
115 (static_cast<uint32_t>(fChromaFilter ) << kChromaFilterShift ) |
116 (static_cast<uint32_t>(fForceExplicitReconstruction) << kForceExplicitReconShift) |
117 (static_cast<uint32_t>(fComponents.r ) << kComponentRShift ) |
118 (static_cast<uint32_t>(fComponents.g ) << kComponentGShift ) |
119 (static_cast<uint32_t>(fComponents.b ) << kComponentBShift ) |
120 (static_cast<uint32_t>(fComponents.a ) << kComponentAShift ));
121 }
#define SkASSERT(cond)
Definition SkAssert.h:116
VkComponentSwizzle r
VkComponentSwizzle a
VkComponentSwizzle g
VkComponentSwizzle b
static constexpr int kForceExplicitReconShift
static constexpr int kComponentBits
static constexpr int kYcbcrModelBits
static constexpr int kChromaFilterShift
static constexpr int kXChromaOffsetBits
static constexpr int kComponentAShift
static constexpr int kChromaFilterBits
static constexpr int kYcbcrModelShift
VkSamplerYcbcrRange fYcbcrRange
static constexpr int kForceExplicitReconBits
static constexpr int kXChromaOffsetShift
static constexpr int kYChromaOffsetBits
static constexpr int kComponentRShift
static constexpr int kYcbcrRangeBits
static constexpr int kYcbcrRangeShift
static constexpr int kYChromaOffsetShift
static constexpr int kComponentBShift
static constexpr int kUsesExternalFormatShift
static constexpr int kComponentGShift
@ VK_FORMAT_UNDEFINED

◆ operator!=()

bool skgpu::VulkanYcbcrConversionInfo::operator!= ( const VulkanYcbcrConversionInfo that) const
inline

Definition at line 87 of file VulkanTypes.h.

87{ return !(*this == that); }

◆ operator==()

bool skgpu::VulkanYcbcrConversionInfo::operator== ( const VulkanYcbcrConversionInfo that) const
inline

Definition at line 63 of file VulkanTypes.h.

63 {
64 // Invalid objects are not required to have all other fields initialized or matching.
65 if (!this->isValid() && !that.isValid()) {
66 return true;
67 }
68
69 // Note that we do not need to check for fFormatFeatures equality. This is because the
70 // Vulkan spec dictates that Android hardware buffers with the same external format must
71 // have the same support for key features. See
72 // https://docs.vulkan.org/spec/latest/chapters/memory.html#_android_hardware_buffer_external_memory
73 // for more details.
74 return this->fFormat == that.fFormat &&
75 this->fExternalFormat == that.fExternalFormat &&
76 this->fYcbcrModel == that.fYcbcrModel &&
77 this->fYcbcrRange == that.fYcbcrRange &&
78 this->fXChromaOffset == that.fXChromaOffset &&
79 this->fYChromaOffset == that.fYChromaOffset &&
80 this->fChromaFilter == that.fChromaFilter &&
81 this->fForceExplicitReconstruction == that.fForceExplicitReconstruction &&
82 this->fComponents.r == that.fComponents.r &&
83 this->fComponents.g == that.fComponents.g &&
84 this->fComponents.b == that.fComponents.b &&
85 this->fComponents.a == that.fComponents.a;
86 }

Member Data Documentation

◆ fChromaFilter

VkFilter skgpu::VulkanYcbcrConversionInfo::fChromaFilter = VK_FILTER_NEAREST

Definition at line 135 of file VulkanTypes.h.

◆ fComponents

VkComponentMapping skgpu::VulkanYcbcrConversionInfo::fComponents

◆ fExternalFormat

uint64_t skgpu::VulkanYcbcrConversionInfo::fExternalFormat = 0

Definition at line 129 of file VulkanTypes.h.

◆ fForceExplicitReconstruction

VkBool32 skgpu::VulkanYcbcrConversionInfo::fForceExplicitReconstruction = false

Definition at line 136 of file VulkanTypes.h.

◆ fFormat

VkFormat skgpu::VulkanYcbcrConversionInfo::fFormat = VK_FORMAT_UNDEFINED

Definition at line 125 of file VulkanTypes.h.

◆ fFormatFeatures

VkFormatFeatureFlags skgpu::VulkanYcbcrConversionInfo::fFormatFeatures = 0

Definition at line 140 of file VulkanTypes.h.

◆ fXChromaOffset

VkChromaLocation skgpu::VulkanYcbcrConversionInfo::fXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN

Definition at line 133 of file VulkanTypes.h.

◆ fYcbcrModel

VkSamplerYcbcrModelConversion skgpu::VulkanYcbcrConversionInfo::fYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY

Definition at line 131 of file VulkanTypes.h.

◆ fYcbcrRange

VkSamplerYcbcrRange skgpu::VulkanYcbcrConversionInfo::fYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL

Definition at line 132 of file VulkanTypes.h.

◆ fYChromaOffset

VkChromaLocation skgpu::VulkanYcbcrConversionInfo::fYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN

Definition at line 134 of file VulkanTypes.h.

◆ kChromaFilterBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kChromaFilterBits = 1
staticconstexpr

Definition at line 153 of file VulkanTypes.h.

◆ kChromaFilterShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kChromaFilterShift = kYChromaOffsetShift + kYChromaOffsetBits
staticconstexpr

Definition at line 163 of file VulkanTypes.h.

◆ kComponentAShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kComponentAShift = kComponentBShift + kComponentBits
staticconstexpr

Definition at line 168 of file VulkanTypes.h.

◆ kComponentBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kComponentBits = 3
staticconstexpr

Definition at line 155 of file VulkanTypes.h.

◆ kComponentBShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kComponentBShift = kComponentGShift + kComponentBits
staticconstexpr

Definition at line 167 of file VulkanTypes.h.

◆ kComponentGShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kComponentGShift = kComponentRShift + kComponentBits
staticconstexpr

Definition at line 166 of file VulkanTypes.h.

◆ kComponentRShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kComponentRShift = kForceExplicitReconShift + kComponentBits
staticconstexpr

Definition at line 165 of file VulkanTypes.h.

◆ kForceExplicitReconBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kForceExplicitReconBits = 1
staticconstexpr

Definition at line 154 of file VulkanTypes.h.

◆ kForceExplicitReconShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kForceExplicitReconShift = kChromaFilterShift + kChromaFilterBits
staticconstexpr

Definition at line 164 of file VulkanTypes.h.

◆ kUsesExternalFormatBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kUsesExternalFormatBits = 1
staticconstexpr

Definition at line 148 of file VulkanTypes.h.

◆ kUsesExternalFormatShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kUsesExternalFormatShift = 0
staticconstexpr

Definition at line 157 of file VulkanTypes.h.

◆ kXChromaOffsetBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kXChromaOffsetBits = 1
staticconstexpr

Definition at line 151 of file VulkanTypes.h.

◆ kXChromaOffsetShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kXChromaOffsetShift = kYcbcrRangeShift + kYcbcrRangeBits
staticconstexpr

Definition at line 161 of file VulkanTypes.h.

◆ kYcbcrModelBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kYcbcrModelBits = 3
staticconstexpr

Definition at line 149 of file VulkanTypes.h.

◆ kYcbcrModelShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kYcbcrModelShift
staticconstexpr
Initial value:

Definition at line 158 of file VulkanTypes.h.

◆ kYcbcrRangeBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kYcbcrRangeBits = 1
staticconstexpr

Definition at line 150 of file VulkanTypes.h.

◆ kYcbcrRangeShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kYcbcrRangeShift = kYcbcrModelShift + kYcbcrModelBits
staticconstexpr

Definition at line 160 of file VulkanTypes.h.

◆ kYChromaOffsetBits

constexpr int skgpu::VulkanYcbcrConversionInfo::kYChromaOffsetBits = 1
staticconstexpr

Definition at line 152 of file VulkanTypes.h.

◆ kYChromaOffsetShift

constexpr int skgpu::VulkanYcbcrConversionInfo::kYChromaOffsetShift = kXChromaOffsetShift + kXChromaOffsetBits
staticconstexpr

Definition at line 162 of file VulkanTypes.h.


The documentation for this struct was generated from the following file: