23#ifdef SK_BUILD_FOR_ANDROID
25 if (
info.fExternalFormat) {
29 externalFormat.
pNext =
nullptr;
32 ycbcrCreateInfo.
pNext = &externalFormat;
39 if (!
info.fExternalFormat) {
43 VkSamplerYcbcrConversion conversion;
46 nullptr, &conversion));
54void GrVkSamplerYcbcrConversion::freeGPUData()
const {
57 fYcbcrConversion,
nullptr));
63 static const int kRangeShift = 3;
73 static const int kCompRShift = kReconShift + 1;
74 static const int kCompGShift = kCompRShift + 3;
75 static const int kCompBShift = kCompGShift + 3;
76 static const int kCompAShift = kCompBShift + 3;
81 static_assert(kCompAShift <= 17);
83 uint32_t ycbcrKey =
static_cast<uint32_t
>(ycbcrInfo.
fYcbcrModel);
84 ycbcrKey |= (
static_cast<uint32_t
>(ycbcrInfo.
fYcbcrRange) << kRangeShift);
89 ycbcrKey |= (
static_cast<uint32_t
>(ycbcrInfo.
fComponents.
r) << kCompRShift);
90 ycbcrKey |= (
static_cast<uint32_t
>(ycbcrInfo.
fComponents.
g) << kCompGShift);
91 ycbcrKey |= (
static_cast<uint32_t
>(ycbcrInfo.
fComponents.
b) << kCompBShift);
92 ycbcrKey |= (
static_cast<uint32_t
>(ycbcrInfo.
fComponents.
a) << kCompAShift);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define GR_VK_CALL(IFACE, X)
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
bool supportsYcbcrConversion() const
const GrVkCaps & vkCaps() const
const skgpu::VulkanInterface * vkInterface() const
static GrVkSamplerYcbcrConversion * Create(GrVkGpu *gpu, const skgpu::VulkanYcbcrConversionInfo &)
static SK_END_REQUIRE_DENSE Key GenerateKey(const skgpu::VulkanYcbcrConversionInfo &ycbcrInfo)
static constexpr int kChromaFilterShift
static constexpr int kYChromaOffsetShift
static constexpr int kXChromaOffsetShift
void SetupSamplerYcbcrConversionInfo(VkSamplerYcbcrConversionCreateInfo *outInfo, const VulkanYcbcrConversionInfo &conversionInfo)
VkSamplerYcbcrRange fYcbcrRange
VkSamplerYcbcrModelConversion fYcbcrModel
VkComponentMapping fComponents
VkBool32 fForceExplicitReconstruction
VkChromaLocation fYChromaOffset
VkChromaLocation fXChromaOffset
@ VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID