summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-08-03 04:20:31 +0200
committerMarek Olšák <[email protected]>2014-08-11 21:53:57 +0200
commit5c69173907e72a0978af5028db336f051ce733b0 (patch)
treefd1ef8abba86226fef5d877aa496694c795bd866 /src/mesa/state_tracker/st_context.c
parentd9a6f4360a617fccfb3987f9ec276012a9a14b75 (diff)
st/mesa: make st_init_extensions context-independent
Setting Const.MaxSamples needed a rework, so that it doesn't call st_choose_format, which depends on st_context. Other than that, there is no change in functionality. Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index ccd19f3e361..9eb3c48bd79 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -201,10 +201,34 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
!!(screen->get_param(screen, PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK) &
(PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 |
PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600));
+ st->has_time_elapsed =
+ screen->get_param(screen, PIPE_CAP_QUERY_TIME_ELAPSED);
/* GL limits and extensions */
st_init_limits(st);
- st_init_extensions(st);
+ st_init_extensions(st->pipe->screen, ctx->API, &ctx->Const,
+ &ctx->Extensions, &st->options, ctx->Mesa_DXTn);
+
+ /* Enable shader-based fallbacks for ARB_color_buffer_float if needed. */
+ if (screen->get_param(screen, PIPE_CAP_VERTEX_COLOR_UNCLAMPED)) {
+ if (!screen->get_param(screen, PIPE_CAP_VERTEX_COLOR_CLAMPED)) {
+ st->clamp_vert_color_in_shader = GL_TRUE;
+ }
+
+ if (!screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMPED)) {
+ st->clamp_frag_color_in_shader = GL_TRUE;
+ }
+
+ /* For drivers which cannot do color clamping, it's better to just
+ * disable ARB_color_buffer_float in the core profile, because
+ * the clamping is deprecated there anyway. */
+ if (ctx->API == API_OPENGL_CORE &&
+ (st->clamp_frag_color_in_shader || st->clamp_vert_color_in_shader)) {
+ st->clamp_vert_color_in_shader = GL_FALSE;
+ st->clamp_frag_color_in_shader = GL_FALSE;
+ ctx->Extensions.ARB_color_buffer_float = GL_FALSE;
+ }
+ }
_mesa_compute_version(ctx);