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

Commit cebc3c8

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

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/mbgl/gl/context.cpp

+15-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,21 @@ 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+
262+
// Blacklist Adreno 3xx, 4xx, and 5xx GPUs due to known bugs:
263+
// https://bugs.chromium.org/p/chromium/issues/detail?id=510637
264+
// https://chromium.googlesource.com/chromium/src/gpu/+/master/config/gpu_driver_bug_list.json#2316
265+
const std::string renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
266+
if (renderer.find("Adreno (TM) 3") != std::string::npos
267+
|| renderer.find("Adreno (TM) 4") != std::string::npos
268+
|| renderer.find("Adreno (TM) 5") != std::string::npos) {
269+
return false;
270+
}
271+
272+
return true;
259273
}
260274

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

0 commit comments

Comments
 (0)