From 8782d57ba60f68426f7c4370152d85c072ca7d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 20 Apr 2023 19:05:42 +0200 Subject: [PATCH] GL: fix "firefox-fake-disjoint-timer-query-webgl2" detection. Firefox used to report iself as "Mozilla by Mozilla" but it's now "Something whatever by Mozilla" which broke the detection. --- doc/changelog.dox | 4 ++++ src/Magnum/GL/Implementation/driverSpecific.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 9d2229ff7..0f2ddc21c 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -970,6 +970,10 @@ See also: [mosra/magnum#535](https://github.com/mosra/magnum/issues/535)) - Fixed various wrong assumptions about Mac builds being always desktop GLES (see [mosra/magnum#](https://github.com/mosra/magnum/issues/541)) +- Fixed the @cpp "firefox-fake-disjoint-timer-query-webgl2" @ce workaround to + work on Firefox again. The reported renderer string got changed, possibly + in relation to @webgl_extension{WEBGL,debug_renderer_info} being + deprecated, which broke Firefox detection in the workaround enabling code. @subsection changelog-latest-deprecated Deprecated APIs diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index 281b1b92d..3aa388bb1 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -743,7 +743,12 @@ void Context::setupDriverWorkarounds() { #endif #if defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) - if(rendererString() == "Mozilla"_s) { + /* Firefox used to report both rendererString() and vendorString() as + Mozilla (printing silly `Renderer: Mozilla by Mozilla` in the Magnum + startup log), but possibly in relation with WEBGL_debug_renderer_info + being deprecated in FF 92+ this changed and now Mozilla is only in + vendorString() and rendererString() is the actual system GPU. */ + if(vendorString() == "Mozilla"_s) { for(const auto& extension: extensionStrings()) { if(extension == "GL_EXT_disjoint_timer_query"_s && !isDriverWorkaroundDisabled("firefox-fake-disjoint-timer-query-webgl2"_s)) { _extensionStatus.set(Extensions::EXT::disjoint_timer_query_webgl2::Index, true);