On 08/22/2012 02:23 AM, Maxim Levitsky wrote:
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<maximlevit...@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");

Nearly all of the Mesa/gallium env vars we have so far are upper-case. One exception is "force_s3tc_enable". I think I'd call this "MESA_FORCE_GLSL_EXTENSIONS_WARN".

In any case, this should also be documented in the docs/envvars.html file.


Ultimately, we should probably have some way to propagate the driconf options up to the state tracker. Maybe some kind of st_api::set_config_option() function.

-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to