Mesa (master): mesa: Add a flag for forcing all GLSL extensions to "warn".

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


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jan 18 12:14:09 2012 -0800

mesa: Add a flag for forcing all GLSL extensions to "warn".

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

---

 src/glsl/glsl_parser_extras.cpp |    3 +++
 src/mesa/main/mtypes.h          |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 0b53232..7f8d47c 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -114,6 +114,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
    }
 
    this->supported_version_string = supported;
+
+   if (ctx->Const.ForceGLSLExtensionsWarn)
+      _mesa_glsl_process_extension("all", NULL, "warn", NULL, this);
 }
 
 const char *
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a2b01d0..99dcb38 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2772,6 +2772,12 @@ struct gl_constants
    GLuint GLSLVersion;  /**< GLSL version supported (ex: 120 = 1.20) */
 
    /**
+    * Changes default GLSL extension behavior from "error" to "warn".  It's out
+    * of spec, but it can make some apps work that otherwise wouldn't.
+    */
+   GLboolean ForceGLSLExtensionsWarn;
+
+   /**
     * Does the driver support real 32-bit integers?  (Otherwise, integers are
     * simulated via floats.)
     */




More information about the mesa-commit mailing list