mesa: call _mesa_make_extension_string only as needed
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 6 Nov 2017 15:33:52 +0000 (15:33 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 16 Nov 2017 14:07:14 +0000 (14:07 +0000)
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@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/context.c
src/mesa/main/getstring.c

index 61099eb39f2e23cfcde188a0dbe8992dc30e207e..762765c9c97bb08d2b2d39990aa5f34b595c865a 100644 (file)
@@ -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
index 4c805ca4d5120af7d7c5712bd317827a19b49de0..931f6a476cb0c22733eda64296aea35aa0e0a182 100644 (file)
@@ -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)