diff --git a/src/gpu/vk/GrVkImage.h b/src/gpu/vk/GrVkImage.h index dab3a756a1..c19621baf8 100644 --- a/src/gpu/vk/GrVkImage.h +++ b/src/gpu/vk/GrVkImage.h @@ -55,6 +55,11 @@ public: } VkFormat imageFormat() const { return fInfo.fFormat; } GrBackendFormat getBackendFormat() const { + if (fResource && this->ycbcrConversionInfo().isValid()) { + SkASSERT(this->imageFormat() == VK_FORMAT_UNDEFINED); + return GrBackendFormat::MakeVk(this->ycbcrConversionInfo()); + } + SkASSERT(this->imageFormat() != VK_FORMAT_UNDEFINED); return GrBackendFormat::MakeVk(this->imageFormat()); } uint32_t mipLevels() const { return fInfo.fLevelCount; }