OpenGL: Fix GLES3 detection for Mesa/Panfrost Mali drivers

The original code checked for "Mali" in GL_RENDERER and disabled GLES3
for all Mali GPUs, which was a workaround for bugs in ARM's proprietary
Mali driver. However, Mesa/Panfrost (open-source Mali driver) does not
have these bugs and should be allowed to use GLES3.

This patch:
- Adds GPU_VENDOR_MESA for identifying Mesa drivers via GL_VENDOR
- Changes the GLES3 ban to only apply when GL_VENDOR="ARM" (proprietary)
- Allows Mesa/Panfrost Mali GPUs to use GLES3 features

Expected behavior:
- ARM proprietary driver (GL_VENDOR="ARM"): GLES3 disabled (preserved)
- Mesa/Panfrost (GL_VENDOR="Mesa"): GLES3 enabled
- Other Mesa drivers: Unaffected

Related issues: #4078, #15413

Signed-off-by: Chris Healy <cphealy@gmail.com>
This commit is contained in:
Chris Healy authored and cphealy committed 2026-03-08 21:41:20 -07:00
1 parent 593e0fd8d9
commit 7ea1260ef0
1 file changed
+8 -2
+8 -2
View File
@@ -192,6 +192,8 @@ bool CheckGLExtensions() {
gl_extensions.gpuVendor = GPU_VENDOR_VIVANTE;
} else if (vendor == "Apple Inc." || vendor == "Apple") {
gl_extensions.gpuVendor = GPU_VENDOR_APPLE;
} else if (vendor == "Mesa") {
gl_extensions.gpuVendor = GPU_VENDOR_MESA;
} else {
WARN_LOG(Log::G3D, "Unknown GL vendor: '%s'", vendor.c_str());
gl_extensions.gpuVendor = GPU_VENDOR_UNKNOWN;
@@ -291,9 +293,13 @@ bool CheckGLExtensions() {
}
gl_extensions.GLES3 = true;
// Though, let's ban Mali from the GLES 3 path for now, see #4078
if (strstr(renderer, "Mali") != 0) {
INFO_LOG(Log::G3D, "Forcing GLES3 off for Mali driver version: %s\n", versionStr ? versionStr : "N/A");
// Only apply to ARM's proprietary driver (GL_VENDOR="ARM"), not Mesa/Panfrost (GL_VENDOR="Mesa")
if (cvendor && strcmp(cvendor, "ARM") == 0 && strstr(renderer, "Mali") != 0) {
INFO_LOG(Log::G3D, "Forcing GLES3 off for ARM Mali proprietary driver version: %s\n", versionStr ? versionStr : "N/A");
gl_extensions.GLES3 = false;
} else if (strstr(renderer, "Mali") != 0) {
// Mali detected but not ARM vendor (likely Mesa/Panfrost) - allow GLES3
INFO_LOG(Log::G3D, "Mali GPU with non-ARM vendor '%s' detected, allowing GLES3\n", cvendor ? cvendor : "N/A");
}
} else {
// Just to be safe.