[Mesa-dev] [PATCH 2/3] state_tracker: allow to utilize GLSL workaround for broken apps in Gallium
Maxim Levitsky
maximlevitsky at gmail.com
Wed Aug 22 01:23:21 PDT 2012
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 <maximlevitsky at gmail.com>
---
src/mesa/state_tracker/st_context.c | 9 +++++++++
src/mesa/state_tracker/st_context.h | 3 +++
2 files changed, 12 insertions(+)
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 2e14da2..b5786b9 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -110,6 +110,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");
+}
+
@@ -193,6 +200,8 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe )
st->has_stencil_export =
screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT);
+ 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 47d3af5..67accd3 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -263,6 +263,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,
--
1.7.9.5
More information about the mesa-dev
mailing list