Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 054c872

Browse files
committed
[android] Disable program caching on Adreno 3xx, 4xx, and 5xx GPUs due to known bugs
1 parent b43e1ae commit 054c872

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/mbgl/gl/context.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,19 @@ bool Context::supportsVertexArrays() const {
255255

256256
#if MBGL_HAS_BINARY_PROGRAMS
257257
bool Context::supportsProgramBinaries() const {
258-
return programBinary && programBinary->programBinary && programBinary->getProgramBinary;
258+
if (!programBinary || !programBinary->programBinary || !programBinary->getProgramBinary)
259+
return false;
260+
261+
// Blacklist Adreno 3xx, 4xx, and 5xx GPUs due to known bugs:
262+
// https://bugs.chromium.org/p/chromium/issues/detail?id=510637
263+
// https://chromium.googlesource.com/chromium/src/gpu/+/master/config/gpu_driver_bug_list.json#2316
264+
std::string renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
265+
if (renderer.find("Adreno (TM) 3") != std::string::npos
266+
|| renderer.find("Adreno (TM) 4") != std::string::npos
267+
|| renderer.find("Adreno (TM) 5") != std::string::npos)
268+
return false;
269+
270+
return true;
259271
}
260272

261273
optional<std::pair<BinaryProgramFormat, std::string>>

0 commit comments

Comments
 (0)