commit 769958ee75fd25712431541f844f467529257460 Author: Maxim Levitsky Date: Wed Aug 15 01:01:37 2012 +0300 state_tracker: allow to utilize GLSL workaround for broken apps in Gallium Currently Gallium has no way to activate the 'force_glsl_extensions_warn' workaround that allows buggy apps that use GLSL extensions without asking for them to work. Since gallium mesa state tracker is essentially split into two, (dri (src/gallium/state_trackers/dri) and mesa (src/mesa/state_tracker)) and only former has access to driconf options while later knows nothing about dri, I added this support by reading an environment variable. export force_glsl_extensions_warn=true Signed-off-by: Maxim Levitsky diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 19d9da1..666addb 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -111,6 +111,13 @@ st_get_msaa(void) return 0; } +bool +st_get_glsl_warn(void) +{ + const char *env = _mesa_getenv("force_glsl_extensions_warn"); + return env && !strcmp(env, "true"); +} + static void st_init_vbuf(struct st_context *st) { @@ -196,6 +203,8 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe ) st->force_msaa = st_get_msaa(); + st->ctx->Const.ForceGLSLExtensionsWarn = st_get_glsl_warn(); + /* GL limits and extensions */ st_init_limits(st); st_init_extensions(st); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 3ec98ad..40838f8 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -277,6 +277,9 @@ st_fb_orientation(const struct gl_framebuffer *fb) extern int st_get_msaa(void); +extern bool +st_get_glsl_warn(void); + extern struct st_context * st_create_context(gl_api api, struct pipe_context *pipe, const struct gl_config *visual,