26#ifdef SK_BUILD_FOR_ANDROID
32 externalFormat.
pNext =
nullptr;
35 ycbcrCreateInfo.
pNext = &externalFormat;
46 VkSamplerYcbcrConversion conversion;
50 CreateSamplerYcbcrConversion(
51 context->
device(), &ycbcrCreateInfo,
nullptr, &conversion));
59 uint32_t nonFormatInfo,
63 bool useExternalFormat =
static_cast<bool>(
68 ycbcrCreateInfo.
pNext =
nullptr;
104#ifdef SK_BUILD_FOR_ANDROID
106 if (useExternalFormat) {
108 externalFormat.
pNext =
nullptr;
111 ycbcrCreateInfo.
pNext = &externalFormat;
115 VkSamplerYcbcrConversion conversion;
119 CreateSamplerYcbcrConversion(
120 context->
device(), &ycbcrCreateInfo,
nullptr, &conversion));
132 return conversionType;
140 conversion_rsrc_type(),
145 if (useExternalFormat) {
166 for (
size_t i = 1;
i < samplerData.
size();
i++) {
175 VkSamplerYcbcrConversion ycbcrConversion)
180 , fYcbcrConversion (ycbcrConversion) {}
182void VulkanYcbcrConversion::freeGpuData() {
186 DestroySamplerYcbcrConversion(
sharedContext->device(), fYcbcrConversion,
nullptr));
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
#define VULKAN_CALL(IFACE, X)
#define VULKAN_CALL_RESULT(SHARED_CONTEXT, RESULT, X)
constexpr size_t size() const
static ResourceType GenerateResourceType()
const GraphiteResourceKey & key() const
const SharedContext * sharedContext() const
bool supportsYcbcrConversion() const
const VulkanCaps & vulkanCaps() const
static GraphiteResourceKey GetKeyFromSamplerDesc(const SamplerDesc &samplerDesc)
static sk_sp< VulkanYcbcrConversion > Make(const VulkanSharedContext *, const VulkanYcbcrConversionInfo &)
static GraphiteResourceKey MakeYcbcrConversionKey(const VulkanSharedContext *, const VulkanYcbcrConversionInfo &)
uint32_t uint32_t * format
static constexpr uint32_t kYChromaOffsetMask
static constexpr uint32_t kComponentAMask
static constexpr uint32_t kYcbcrRangeMask
static constexpr int kComponentBShift
static constexpr int kChromaFilterShift
static constexpr uint32_t kComponentGMask
static constexpr uint32_t kXChromaOffsetMask
static constexpr int kYChromaOffsetShift
int numInt32sNeeded(const VulkanYcbcrConversionInfo &conversionInfo)
static constexpr int kComponentAShift
static constexpr uint32_t kUseExternalFormatMask
static constexpr uint32_t kYcbcrModelMask
static constexpr int kYcbcrRangeShift
static constexpr int kUsesExternalFormatShift
static constexpr int kComponentRShift
static constexpr int kComponentGShift
static constexpr int kForceExplicitReconShift
static constexpr uint32_t kChromaFilterMask
static constexpr int kXChromaOffsetShift
uint32_t nonFormatInfoAsUInt32(const VulkanYcbcrConversionInfo &conversionInfo)
static constexpr uint32_t kForceExplicitReconMask
static constexpr uint32_t kComponentRMask
static constexpr uint32_t kComponentBMask
static constexpr int kYcbcrModelShift
void SetupSamplerYcbcrConversionInfo(VkSamplerYcbcrConversionCreateInfo *outInfo, const VulkanYcbcrConversionInfo &conversionInfo)
VkChromaLocation xChromaOffset
VkComponentMapping components
VkSamplerYcbcrRange ycbcrRange
VkBool32 forceExplicitReconstruction
VkSamplerYcbcrModelConversion ycbcrModel
VkChromaLocation yChromaOffset
static constexpr int kImmutableSamplerInfoShift
SkSpan< const uint32_t > asSpan() const
VkSamplerYcbcrModelConversion
@ VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO
@ VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID