st/mesa: drop dependence on API profile in st_init_extensions
authorMarek Olšák <marek.olsak@amd.com>
Fri, 12 Sep 2014 14:41:19 +0000 (16:41 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 24 Sep 2014 12:48:02 +0000 (14:48 +0200)
The extensions and limits being set in the conditional block are core-only
anyway and don't have any effect on other profiles.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_extensions.h
src/mesa/state_tracker/st_manager.c

index 768a667901e19bda1775932386fe07ab67b82377..17235132eeab177def0b530bcc766a706029309e 100644 (file)
@@ -242,7 +242,7 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
 
    /* GL limits and extensions */
    st_init_limits(st->pipe->screen, &ctx->Const, &ctx->Extensions);
-   st_init_extensions(st->pipe->screen, ctx->API, &ctx->Const,
+   st_init_extensions(st->pipe->screen, &ctx->Const,
                       &ctx->Extensions, &st->options, ctx->Mesa_DXTn);
 
    /* Enable shader-based fallbacks for ARB_color_buffer_float if needed. */
index c7bc0ca5009162378971cc0e82ca3f664bfd74d9..681723ab0b41a254dcf05d2a552d8b65fb86ed7e 100644 (file)
@@ -407,7 +407,6 @@ get_max_samples_for_formats(struct pipe_screen *screen,
  * Some fine tuning may still be needed.
  */
 void st_init_extensions(struct pipe_screen *screen,
-                        gl_api api,
                         struct gl_constants *consts,
                         struct gl_extensions *extensions,
                         struct st_config_options *options,
@@ -844,17 +843,16 @@ void st_init_extensions(struct pipe_screen *screen,
          consts->DisableVaryingPacking = GL_TRUE;
    }
 
-   if (api == API_OPENGL_CORE) {
-      consts->MaxViewports = screen->get_param(screen, PIPE_CAP_MAX_VIEWPORTS);
-      if (consts->MaxViewports >= 16) {
-         consts->ViewportBounds.Min = -16384.0;
-         consts->ViewportBounds.Max = 16384.0;
-         extensions->ARB_viewport_array = GL_TRUE;
-         extensions->ARB_fragment_layer_viewport = GL_TRUE;
-         if (extensions->AMD_vertex_shader_layer)
-            extensions->AMD_vertex_shader_viewport_index = GL_TRUE;
-      }
+   consts->MaxViewports = screen->get_param(screen, PIPE_CAP_MAX_VIEWPORTS);
+   if (consts->MaxViewports >= 16) {
+      consts->ViewportBounds.Min = -16384.0;
+      consts->ViewportBounds.Max = 16384.0;
+      extensions->ARB_viewport_array = GL_TRUE;
+      extensions->ARB_fragment_layer_viewport = GL_TRUE;
+      if (extensions->AMD_vertex_shader_layer)
+         extensions->AMD_vertex_shader_viewport_index = GL_TRUE;
    }
+
    if (consts->MaxProgramTextureGatherComponents > 0)
       extensions->ARB_texture_gather = GL_TRUE;
 
index 8d2724d67f692bcd520ddd6ac5a47e82c73fb7a7..faff11fd5d1172bd4a97ac5f5b98074d93addafe 100644 (file)
@@ -38,7 +38,6 @@ extern void st_init_limits(struct pipe_screen *screen,
                            struct gl_extensions *extensions);
 
 extern void st_init_extensions(struct pipe_screen *screen,
-                               gl_api api,
                                struct gl_constants *consts,
                                struct gl_extensions *extensions,
                                struct st_config_options *options,
index 7bc33268e76392613265fa4430c72752bc4dbb2b..df6de737fb6e0e98ad82ae9d5e4fd7eb3b469c17 100644 (file)
@@ -928,7 +928,7 @@ static unsigned get_version(struct pipe_screen *screen,
    _mesa_init_extensions(&extensions);
 
    st_init_limits(screen, &consts, &extensions);
-   st_init_extensions(screen, api, &consts, &extensions, options, GL_TRUE);
+   st_init_extensions(screen, &consts, &extensions, options, GL_TRUE);
 
    return _mesa_get_version(&extensions, &consts, api);
 }