summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2012-12-04 16:29:00 -0800
committerCarl Worth <[email protected]>2013-01-11 13:55:41 -0800
commitc0c9c9966f54b2e4a4eb2ffa2abe343c1b82b823 (patch)
tree5321475645fa700f9a91bf6018e06ddf4b1401ee
parentc6c575c69abd104397946cbd8f20b3451fdeb369 (diff)
driconf: Add a new option: disable_glsl_line_continuations
This is to enable a quirk for Savage2 which includes a shader with a stray '\' at the end of a comment line. Interpreting that backslash as a line continuation will break the compilation of the shader, so we need a way to disable this. Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/t_options.h5
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c3
-rw-r--r--src/mesa/main/mtypes.h6
4 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/xmlpool/t_options.h b/src/mesa/drivers/dri/common/xmlpool/t_options.h
index 78f17650b2c..683a473660b 100644
--- a/src/mesa/drivers/dri/common/xmlpool/t_options.h
+++ b/src/mesa/drivers/dri/common/xmlpool/t_options.h
@@ -282,3 +282,8 @@ DRI_CONF_OPT_END
DRI_CONF_OPT_BEGIN(disable_blend_func_extended,bool,def) \
DRI_CONF_DESC(en,gettext("Disable dual source blending")) \
DRI_CONF_OPT_END
+
+#define DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(def) \
+DRI_CONF_OPT_BEGIN(disable_glsl_line_continuations,bool,def) \
+ DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \
+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 df0f8d60491..cf4cedd3df5 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -377,6 +377,8 @@ brwCreateContext(int api,
ctx->Const.ForceGLSLExtensionsWarn = driQueryOptionb(&intel->optionCache, "force_glsl_extensions_warn");
+ ctx->Const.DisableGLSLLineContinuations = driQueryOptionb(&intel->optionCache, "disable_glsl_line_continuations");
+
ctx->Const.ContextFlags = 0;
if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0)
ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index e0fe8c186cb..557f1af7aa8 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -80,6 +80,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_ALWAYS_FLUSH_BATCH(false)
DRI_CONF_ALWAYS_FLUSH_CACHE(false)
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
+ DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(false)
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
@@ -92,7 +93,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_SECTION_END
DRI_CONF_END;
-const GLuint __driNConfigOptions = 15;
+const GLuint __driNConfigOptions = 16;
#include "intel_batchbuffer.h"
#include "intel_buffers.h"
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index f44ec4947ed..f7b90cfcf17 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2984,6 +2984,12 @@ struct gl_constants
* \sa _mesa_init_constants
*/
GLuint64 MaxElementIndex;
+
+ /**
+ * Disable interpretation of line continuations (lines ending with a
+ * backslash character ('\') in GLSL source.
+ */
+ GLboolean DisableGLSLLineContinuations;
};