Respect disable driver correctness workaround flag in Vulkan
Bug: skia:
Change-Id: Ibbfac1ec5d290d3ed4a6fefbc1cec04377fcd9bc
Reviewed-on: https://skia-review.googlesource.com/111020
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 869d6e0..e5037df 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -19,7 +19,7 @@
: INHERITED(contextOptions) {
fCanUseGLSLForShaderModule = false;
fMustDoCopiesFromOrigin = false;
- fSupportsCopiesAsDraws = false;
+ fSupportsCopiesAsDraws = true;
fMustSubmitCommandsBeforeCopyOp = false;
fMustSleepOnTearDown = false;
fNewCBOnPipelineChange = false;
@@ -40,7 +40,7 @@
fBlacklistCoverageCounting = true; // blacklisting ccpr until we work through a few issues.
fFenceSyncSupport = true; // always available in Vulkan
- fCrossContextTextureSupport = false;
+ fCrossContextTextureSupport = true;
fMapBufferFlags = kNone_MapFlags; //TODO: figure this out
fBufferMapThreshold = SK_MaxS32; //TODO: figure this out
@@ -88,12 +88,15 @@
this->initConfigTable(vkInterface, physDev, properties);
this->initStencilFormat(vkInterface, physDev);
- if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) {
- // Currently disabling this feature since it does not play well with validation layers which
- // expect a SPIR-V shader
- // fCanUseGLSLForShaderModule = true;
+ if (!contextOptions.fDisableDriverCorrectnessWorkarounds) {
+ this->applyDriverCorrectnessWorkarounds(properties);
}
+ this->applyOptionsOverrides(contextOptions);
+ fShaderCaps->applyOptionsOverrides(contextOptions);
+}
+
+void GrVkCaps::applyDriverCorrectnessWorkarounds(const VkPhysicalDeviceProperties& properties) {
if (kQualcomm_VkVendor == properties.vendorID) {
fMustDoCopiesFromOrigin = true;
}
@@ -102,13 +105,11 @@
fMustSubmitCommandsBeforeCopyOp = true;
}
- if (kQualcomm_VkVendor != properties.vendorID &&
- kARM_VkVendor != properties.vendorID) {
- fSupportsCopiesAsDraws = true;
- }
-
- if (fSupportsCopiesAsDraws) {
- fCrossContextTextureSupport = true;
+ if (kQualcomm_VkVendor == properties.vendorID ||
+ kARM_VkVendor == properties.vendorID) {
+ fSupportsCopiesAsDraws = false;
+ // We require copies as draws to support cross context textures.
+ fCrossContextTextureSupport = false;
}
if (kARM_VkVendor == properties.vendorID) {
@@ -124,9 +125,6 @@
fMustSleepOnTearDown = true;
}
#endif
-
- this->applyOptionsOverrides(contextOptions);
- fShaderCaps->applyOptionsOverrides(contextOptions);
}
int get_max_sample_count(VkSampleCountFlags flags) {