From a908d7ed716da25d950afb73806d93c49ef1e870 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 20 Jul 2017 16:54:10 -0700 Subject: [PATCH] [android] Disable program caching on Adreno 3xx, 4xx, and 5xx GPUs due to known bugs --- src/mbgl/gl/context.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 1a8d5c0775f..55dde604d3d 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -255,7 +255,21 @@ bool Context::supportsVertexArrays() const { #if MBGL_HAS_BINARY_PROGRAMS bool Context::supportsProgramBinaries() const { - return programBinary && programBinary->programBinary && programBinary->getProgramBinary; + if (!programBinary || !programBinary->programBinary || !programBinary->getProgramBinary) { + return false; + } + + // Blacklist Adreno 3xx, 4xx, and 5xx GPUs due to known bugs: + // https://bugs.chromium.org/p/chromium/issues/detail?id=510637 + // https://chromium.googlesource.com/chromium/src/gpu/+/master/config/gpu_driver_bug_list.json#2316 + const std::string renderer = reinterpret_cast(glGetString(GL_RENDERER)); + if (renderer.find("Adreno (TM) 3") != std::string::npos + || renderer.find("Adreno (TM) 4") != std::string::npos + || renderer.find("Adreno (TM) 5") != std::string::npos) { + return false; + } + + return true; } optional>