Move workaround for fSRGBsupport before config table init in GrVkCaps
Bug: skia:
Change-Id: Ibd03f77dbdf2a3ee4b189443699d755f3510f044
Reviewed-on: https://skia-review.googlesource.com/111540
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 649f68b..08d8790 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -85,6 +85,16 @@
this->initGrCaps(properties, memoryProperties, featureFlags);
this->initShaderCaps(properties, featureFlags);
+
+ if (!contextOptions.fDisableDriverCorrectnessWorkarounds) {
+#if defined(SK_CPU_X86)
+ // We need to do this before initing the config table since it uses fSRGBSupport
+ if (kImagination_VkVendor == properties.vendorID) {
+ fSRGBSupport = false;
+ }
+#endif
+ }
+
this->initConfigTable(vkInterface, physDev, properties);
this->initStencilFormat(vkInterface, physDev);
@@ -145,12 +155,6 @@
fCanUseWholeSizeOnFlushMappedMemory = false;
}
-#if defined(SK_CPU_X86)
- if (kImagination_VkVendor == properties.vendorID) {
- fSRGBSupport = false;
- }
-#endif
-
////////////////////////////////////////////////////////////////////////////
// GrShaderCaps workarounds
////////////////////////////////////////////////////////////////////////////