Mesa (master): i965: Add a driconf option to force GLSL extension behavior to "warn".

Eric Anholt anholt at kemper.freedesktop.org
Mon Jan 30 19:46:22 UTC 2012


Module: Mesa
Branch: master
Commit: 642247883fb9e6dce9bad724f7f6503321e0ef6f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=642247883fb9e6dce9bad724f7f6503321e0ef6f

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jan 25 14:13:13 2012 -0800

i965: Add a driconf option to force GLSL extension behavior to "warn".

This can be used to work around broken application behavior, like in
Unigine where it attempts to use texture arrays without declaring
either "#extension GL_EXT_texture_array : enable" or "#version 130".

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/common/xmlpool/options.h |   10 ++++++++++
 src/mesa/drivers/dri/i965/brw_context.c       |    2 ++
 src/mesa/drivers/dri/intel/intel_screen.c     |    3 ++-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h
index 1e584ba..75c887e 100644
--- a/src/mesa/drivers/dri/common/xmlpool/options.h
+++ b/src/mesa/drivers/dri/common/xmlpool/options.h
@@ -626,3 +626,13 @@ DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \
         DRI_CONF_DESC(fr,"Enable flushing GPU caches with each draw call") \
         DRI_CONF_DESC(sv,"Enable flushing GPU caches with each draw call") \
 DRI_CONF_OPT_END
+
+#define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \
+DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \
+        DRI_CONF_DESC(en,"Force GLSL extension default behavior to 'warn'") \
+        DRI_CONF_DESC(de,"Force GLSL extension default behavior to 'warn'") \
+        DRI_CONF_DESC(es,"Force GLSL extension default behavior to 'warn'") \
+        DRI_CONF_DESC(nl,"Force GLSL extension default behavior to 'warn'") \
+        DRI_CONF_DESC(fr,"Force GLSL extension default behavior to 'warn'") \
+        DRI_CONF_DESC(sv,"Force GLSL extension default behavior to 'warn'") \
+DRI_CONF_OPT_END
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 87ea1a5..1ab6310 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -372,6 +372,8 @@ brwCreateContext(int api,
    ctx->Const.NativeIntegers = true;
    ctx->Const.UniformBooleanTrue = 1;
 
+   ctx->Const.ForceGLSLExtensionsWarn = driQueryOptionb(&intel->optionCache, "force_glsl_extensions_warn");
+
    return true;
 }
 
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 1c50830..063bbe7 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -74,6 +74,7 @@ PUBLIC const char __driConfigOptions[] =
      DRI_CONF_NO_RAST(false)
      DRI_CONF_ALWAYS_FLUSH_BATCH(false)
      DRI_CONF_ALWAYS_FLUSH_CACHE(false)
+     DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
 
       DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
 	 DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
@@ -85,7 +86,7 @@ PUBLIC const char __driConfigOptions[] =
    DRI_CONF_SECTION_END
 DRI_CONF_END;
 
-const GLuint __driNConfigOptions = 12;
+const GLuint __driNConfigOptions = 13;
 
 #include "intel_batchbuffer.h"
 #include "intel_buffers.h"




More information about the mesa-commit mailing list