summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-05 22:29:58 +0200
committerIan Romanick <ian.d.romanick@intel.com>2010-09-08 20:36:37 -0700
commite591c4625cae63660c5000fbab366e40fe154ab0 (patch)
tree06b65ce727933c9bc7be208085c7400ed5b37f6f /src/mesa/main
parent6d3a2c97f4a78e85545286e0e126cd3a27bd1cbd (diff)
glsl: add several EmitNo* options, and MaxUnrollIterations
This increases the chance that GLSL programs will actually work. Note that continues and returns are not yet lowered, so linking will just fail if not supported. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h7
-rw-r--r--src/mesa/main/shaderapi.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 61cd93c364..3e54656981 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2187,7 +2187,6 @@ struct gl_shader_compiler_options
{
/** Driver-selectable options: */
GLboolean EmitHighLevelInstructions; /**< IF/ELSE/ENDIF vs. BRA, etc. */
- GLboolean EmitContReturn; /**< Emit CONT/RET opcodes? */
GLboolean EmitCondCodes; /**< Use condition codes? */
GLboolean EmitComments; /**< Annotated instructions */
GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */
@@ -2196,6 +2195,12 @@ struct gl_shader_compiler_options
* support control flow.
*/
GLboolean EmitNoIfs;
+ GLboolean EmitNoLoops;
+ GLboolean EmitNoFunctions;
+ GLboolean EmitNoCont; /**< Emit CONT opcode? */
+ GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */
+
+ GLuint MaxUnrollIterations;
struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */
};
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 2977a29ab7..c32c09f8d4 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -97,10 +97,14 @@ _mesa_init_shader_state(GLcontext *ctx)
struct gl_shader_compiler_options options;
GLuint i;
options.EmitHighLevelInstructions = GL_TRUE;
- options.EmitContReturn = GL_TRUE;
options.EmitCondCodes = GL_FALSE;
options.EmitComments = GL_FALSE;
options.EmitNoIfs = GL_FALSE;
+ options.EmitNoLoops = GL_FALSE;
+ options.EmitNoFunctions = GL_FALSE;
+ options.EmitNoCont = GL_FALSE;
+ options.EmitNoMainReturn = GL_FALSE;
+ options.MaxUnrollIterations = 32;
/* Default pragma settings */
options.DefaultPragmas.IgnoreOptimize = GL_FALSE;