Module: Mesa Branch: master Commit: 6bb9acfb4eb3f6a2c61e03cbd5a6c6c464d2ae0c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6bb9acfb4eb3f6a2c61e03cbd5a6c6c464d2ae0c
Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Apr 17 17:30:21 2013 -0700 glsl: Initialize ctx->ShaderCompilerOptions in standalone scaffolding. This code is copied from _mesa_init_shader_state(). Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Ian Romanick <ian.d.roman...@intel.com> Reviewed-by: Eric Anholt <e...@anholt.net> --- src/glsl/standalone_scaffolding.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp index 8653c4e..11cd6cd 100644 --- a/src/glsl/standalone_scaffolding.cpp +++ b/src/glsl/standalone_scaffolding.cpp @@ -123,4 +123,16 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Const.FragmentProgram.MaxUniformComponents = 64; ctx->Const.MaxDrawBuffers = 1; + + /* Set up default shader compiler options. */ + struct gl_shader_compiler_options options; + memset(&options, 0, sizeof(options)); + options.MaxUnrollIterations = 32; + options.MaxIfDepth = UINT_MAX; + + /* Default pragma settings */ + options.DefaultPragmas.Optimize = true; + + for (int sh = 0; sh < MESA_SHADER_TYPES; ++sh) + memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options)); } _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit