gpu: Disable dual source blending support on buggy driver versions.

R=bsalomon@google.com

Bug:1027981
Change-Id: I1f0704451fadcd845a0f8845d728f4b8986d88ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261211
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
This commit is contained in:
Khushal Sagar 2019-12-20 12:20:44 -08:00 committed by Skia Commit-Bot
parent 9c4ee9c79a
commit 988db63351
3 changed files with 11 additions and 3 deletions

View File

@ -12,6 +12,8 @@
disable_blend_equation_advanced) \ disable_blend_equation_advanced) \
GPU_OP(DISABLE_DISCARD_FRAMEBUFFER, \ GPU_OP(DISABLE_DISCARD_FRAMEBUFFER, \
disable_discard_framebuffer) \ disable_discard_framebuffer) \
GPU_OP(DISABLE_DUAL_SOURCE_BLENDING_SUPPORT, \
disable_dual_source_blending_support) \
GPU_OP(DISABLE_TEXTURE_STORAGE, \ GPU_OP(DISABLE_TEXTURE_STORAGE, \
disable_texture_storage) \ disable_texture_storage) \
GPU_OP(DISALLOW_LARGE_INSTANCED_DRAW, \ GPU_OP(DISALLOW_LARGE_INSTANCED_DRAW, \

View File

@ -352,9 +352,10 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
// Enable supported shader-related caps // Enable supported shader-related caps
if (GR_IS_GR_GL(standard)) { if (GR_IS_GR_GL(standard)) {
shaderCaps->fDualSourceBlendingSupport = (version >= GR_GL_VER(3, 3) || shaderCaps->fDualSourceBlendingSupport =
ctxInfo.hasExtension("GL_ARB_blend_func_extended")) && (version >= GR_GL_VER(3, 3) ||
ctxInfo.glslGeneration() >= k130_GrGLSLGeneration; ctxInfo.hasExtension("GL_ARB_blend_func_extended")) &&
ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
shaderCaps->fShaderDerivativeSupport = true; shaderCaps->fShaderDerivativeSupport = true;
@ -3583,6 +3584,10 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
shaderCaps->fRemovePowWithConstantExponent = true; shaderCaps->fRemovePowWithConstantExponent = true;
} }
if (fDriverBugWorkarounds.disable_dual_source_blending_support) {
shaderCaps->fDualSourceBlendingSupport = false;
}
if (kAdreno3xx_GrGLRenderer == ctxInfo.renderer() || if (kAdreno3xx_GrGLRenderer == ctxInfo.renderer() ||
kAdreno4xx_other_GrGLRenderer == ctxInfo.renderer()) { kAdreno4xx_other_GrGLRenderer == ctxInfo.renderer()) {
shaderCaps->fMustWriteToFragColor = true; shaderCaps->fMustWriteToFragColor = true;

View File

@ -15,3 +15,4 @@ restore_scissor_on_fbo_change
rewrite_do_while_loops rewrite_do_while_loops
unbind_attachments_on_bound_render_fbo_delete unbind_attachments_on_bound_render_fbo_delete
unfold_short_circuit_as_ternary_operation unfold_short_circuit_as_ternary_operation
disable_dual_source_blending_support