Index: src/gpu/vk/GrVkImage.cpp |
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp |
index 9e7faf4706e9ef0f3d7441f163df6a325e9b60d8..d3195e7e8a0a9f41c6f96fe842e7b69aef471b65 100644 |
--- a/src/gpu/vk/GrVkImage.cpp |
+++ b/src/gpu/vk/GrVkImage.cpp |
@@ -77,10 +77,14 @@ bool GrVkImage::InitImageInfo(const GrVkGpu* gpu, const ImageDesc& imageDesc, Gr |
SkASSERT(VK_IMAGE_TILING_OPTIMAL == imageDesc.fImageTiling || |
VK_SAMPLE_COUNT_1_BIT == vkSamples); |
+ // sRGB format images may need to be aliased to linear for various reasons (legacy mode): |
+ VkImageCreateFlags createFlags = GrVkFormatIsSRGB(imageDesc.fFormat, nullptr) |
+ ? VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT : 0; |
+ |
const VkImageCreateInfo imageCreateInfo = { |
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // sType |
NULL, // pNext |
- 0, // VkImageCreateFlags |
+ createFlags, // VkImageCreateFlags |
imageDesc.fImageType, // VkImageType |
imageDesc.fFormat, // VkFormat |
{ imageDesc.fWidth, imageDesc.fHeight, 1 }, // VkExtent3D |