mesa: Add a flag for forcing all GLSL extensions to "warn".
authorEric Anholt <eric@anholt.net>
Wed, 18 Jan 2012 20:14:09 +0000 (12:14 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 30 Jan 2012 19:41:49 +0000 (11:41 -0800)
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_parser_extras.cpp
src/mesa/main/mtypes.h

index 0b53232e9e7538aa907347264534bc1ac98938cc..7f8d47ce9bccf3f5b2fd12fe7230fbb48e105688 100644 (file)
@@ -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 *
index a2b01d05d2215b1d05f3626e0e8158ee19faba77..99dcb389b62441ed677db0b2f1334971fc5c09df 100644 (file)
@@ -2771,6 +2771,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.)