aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-02-28 14:21:34 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-28 19:42:04 +0000
commit691f5e7890a15165fd6273bdacf750ccb309fc8b (patch)
treeef127f03cbf69c652371275ef8d94e93818131a2 /src
parenta556684b10ca2cb5c75c90f831f427400f1ae7ec (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp4
-rw-r--r--src/gpu/vk/GrVkCaps.cpp30
-rw-r--r--src/gpu/vk/GrVkCaps.h2
3 files changed, 19 insertions, 17 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index c31cdc75bf..9068525148 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -2066,7 +2066,9 @@ bool GrGLCaps::initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc*
return true;
}
-void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo, const GrContextOptions& contextOptions, GrShaderCaps* shaderCaps) {
+void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
+ const GrContextOptions& contextOptions,
+ GrShaderCaps* shaderCaps) {
// A driver but on the nexus 6 causes incorrect dst copies when invalidate is called beforehand.
// Thus we are blacklisting this extension for now on Adreno4xx devices.
if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer()) {
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 869d6e0e10..e5037dfb3e 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -19,7 +19,7 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
: INHERITED(contextOptions) {
fCanUseGLSLForShaderModule = false;
fMustDoCopiesFromOrigin = false;
- fSupportsCopiesAsDraws = false;
+ fSupportsCopiesAsDraws = true;
fMustSubmitCommandsBeforeCopyOp = false;
fMustSleepOnTearDown = false;
fNewCBOnPipelineChange = false;
@@ -40,7 +40,7 @@ GrVkCaps::GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface*
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 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
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 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
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 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
fMustSleepOnTearDown = true;
}
#endif
-
- this->applyOptionsOverrides(contextOptions);
- fShaderCaps->applyOptionsOverrides(contextOptions);
}
int get_max_sample_count(VkSampleCountFlags flags) {
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index 14f37c94eb..809cbf5407 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -145,6 +145,8 @@ private:
void initConfigTable(const GrVkInterface*, VkPhysicalDevice, const VkPhysicalDeviceProperties&);
void initStencilFormat(const GrVkInterface* iface, VkPhysicalDevice physDev);
+ void applyDriverCorrectnessWorkarounds(const VkPhysicalDeviceProperties&);
+
struct ConfigInfo {
ConfigInfo() : fOptimalFlags(0), fLinearFlags(0) {}