From b52fa02227d8e7413d174bc5b3808f795d0215f0 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 7 Jun 2017 09:42:52 -0400 Subject: Limit Adreno 4xx stencil clear workaround to older drivers Bug: skia:5587 Change-Id: I00f377c06228deb9053b1cf7d9f413e0bf2fb490 Reviewed-on: https://skia-review.googlesource.com/18936 Reviewed-by: Brian Osman Commit-Queue: Brian Salomon --- src/gpu/gl/GrGLCaps.cpp | 6 +++++- src/gpu/gl/GrGLUtil.cpp | 10 ++++++++++ src/gpu/gl/GrGLUtil.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/gpu') diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 44d25299ae..0f3d7add82 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -512,7 +512,11 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer()) { fUseDrawInsteadOfPartialRenderTargetWrite = true; - fUseDrawToClearStencilClip = true; + // This is known to be fixed sometime between driver 145.0 and 219.0 + if (ctxInfo.driver() == kQualcomm_GrGLDriver && + ctxInfo.driverVersion() <= GR_GL_DRIVER_VER(219, 0)) { + fUseDrawToClearStencilClip = true; + } } // Texture uploads sometimes seem to be ignored to textures bound to FBOS on Tegra3. diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index cf4615ad86..6da7c20aec 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -173,6 +173,16 @@ void GrGLGetDriverInfo(GrGLStandard standard, // We presume we're on the Intel driver since it hasn't identified itself as Mesa. *outDriver = kIntel_GrGLDriver; } + + if (kQualcomm_GrGLVendor == vendor) { + *outDriver = kQualcomm_GrGLDriver; + int n = sscanf(versionString, "OpenGL ES %d.%d V@%d.%d", &major, &minor, &driverMajor, + &driverMinor); + if (4 == n) { + *outVersion = GR_GL_DRIVER_VER(driverMajor, driverMinor); + } + return; + } } GrGLVersion GrGLGetVersionFromString(const char* versionString) { diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h index fc2594a3a0..b798385cf6 100644 --- a/src/gpu/gl/GrGLUtil.h +++ b/src/gpu/gl/GrGLUtil.h @@ -68,6 +68,7 @@ enum GrGLDriver { kNVIDIA_GrGLDriver, kIntel_GrGLDriver, kANGLE_GrGLDriver, + kQualcomm_GrGLDriver, kUnknown_GrGLDriver }; -- cgit v1.2.3