[tor-commits] [tor-browser] 65/76: Bug 1744525 - Add missing IsMesa definition. a=bustage

gitolite role git at cupani.torproject.org
Wed Mar 30 20:40:33 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.8.0esr-11.0-1
in repository tor-browser.

commit b2a224bbf181bfdc3af87c5d2291d6f4d2df3da2
Author: Jeff Gilbert <jgilbert at mozilla.com>
AuthorDate: Thu Mar 24 10:34:57 2022 -0400

    Bug 1744525 - Add missing IsMesa definition. a=bustage
    
    This was originally added by bug 1657189 for 93+.
---
 gfx/gl/GLContext.cpp | 11 +++++++++--
 gfx/gl/GLContext.h   |  3 ++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp
index b086b6c2bb502..b5000b5f0c560 100644
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -666,11 +666,19 @@ bool GLContext::InitImpl() {
     }
   }
 
+  {
+    const auto versionStr = (const char*)fGetString(LOCAL_GL_VERSION);
+    if (strstr(versionStr, "Mesa")) {
+      mIsMesa = true;
+    }
+  }
+
   if (ShouldSpew()) {
     printf_stderr("GL_VENDOR: %s\n", glVendorString);
     printf_stderr("mVendor: %s\n", vendorMatchStrings[size_t(mVendor)]);
     printf_stderr("GL_RENDERER: %s\n", glRendererString);
     printf_stderr("mRenderer: %s\n", rendererMatchStrings[size_t(mRenderer)]);
+    printf_stderr("mIsMesa: %i\n", int(mIsMesa));
   }
 
   ////////////////
@@ -732,8 +740,7 @@ bool GLContext::InitImpl() {
       MarkUnsupported(GLFeature::framebuffer_multisample);
     }
 
-    const auto versionStr = (const char*)fGetString(LOCAL_GL_VERSION);
-    if (strstr(versionStr, "Mesa")) {
+    if (IsMesa()) {
       // DrawElementsInstanced hangs the driver.
       MarkUnsupported(GLFeature::robust_buffer_access_behavior);
     }
diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h
index d8da2ccc7ee3f..9f4a93205c3a1 100644
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -280,8 +280,8 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
   }
 
   GLVendor Vendor() const { return mVendor; }
-
   GLRenderer Renderer() const { return mRenderer; }
+  bool IsMesa() const { return mIsMesa; }
 
   bool IsContextLost() const { return mContextLost; }
 
@@ -335,6 +335,7 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
 
   GLVendor mVendor = GLVendor::Other;
   GLRenderer mRenderer = GLRenderer::Other;
+  bool mIsMesa = false;
 
   // -----------------------------------------------------------------------------
   // Extensions management

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list