Mesa (master): mesa: call _mesa_make_extension_string only as needed

Emil Velikov evelikov at kemper.freedesktop.org
Thu Nov 16 14:18:58 UTC 2017


Module: Mesa
Branch: master
Commit: 167e958a87d53614e6bbb78b09bafcea17335b4b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=167e958a87d53614e6bbb78b09bafcea17335b4b

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Mon Nov  6 15:33:52 2017 +0000

mesa: call _mesa_make_extension_string only as needed

As of previous commit we removed the extension overrides from this
function.

Thus we no longer need to call it during MakeCurrent, so we can
construct the extensions string when needed - _mesa_GetString.

This commit effectively reverts a879d14ecf8 ("mesa: initialize extension
string when context is first bound")

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/context.c   | 2 --
 src/mesa/main/getstring.c | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 61099eb39f..762765c9c9 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1576,8 +1576,6 @@ handle_first_current(struct gl_context *ctx)
       return;
    }
 
-   ctx->Extensions.String = _mesa_make_extension_string(ctx);
-
    check_context_limits(ctx);
 
    /* According to GL_MESA_configless_context the default value of
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 4c805ca4d5..931f6a476c 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -143,6 +143,8 @@ _mesa_GetString( GLenum name )
             _mesa_error(ctx, GL_INVALID_ENUM, "glGetString(GL_EXTENSIONS)");
             return (const GLubyte *) 0;
          }
+         if (!ctx->Extensions.String)
+            ctx->Extensions.String = _mesa_make_extension_string(ctx);
          return (const GLubyte *) ctx->Extensions.String;
       case GL_SHADING_LANGUAGE_VERSION:
          if (ctx->API == API_OPENGLES)




More information about the mesa-commit mailing list