From 65fc2ca82a38bc00ae4223124932af6771765041 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Mar 2009 10:25:24 -0600 Subject: glsl: change GLSL #pragma initialization Initialize the shader's pragma settings before calling the compiler. Added pragma "Ignore" fields to allow overriding the #pragma directives found in shader source code. --- src/mesa/shader/shader_api.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa/shader/shader_api.c') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 9900acc75b..61289db2d2 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -410,6 +410,12 @@ _mesa_init_shader_state(GLcontext * ctx) ctx->Shader.EmitCondCodes = GL_FALSE; ctx->Shader.EmitComments = GL_FALSE; ctx->Shader.Flags = get_shader_flags(); + + /* Default pragma settings */ + ctx->Shader.DefaultPragmas.IgnoreOptimize = GL_FALSE; + ctx->Shader.DefaultPragmas.IgnoreDebug = GL_FALSE; + ctx->Shader.DefaultPragmas.Optimize = GL_TRUE; + ctx->Shader.DefaultPragmas.Debug = GL_FALSE; } @@ -1444,6 +1450,9 @@ _mesa_compile_shader(GLcontext *ctx, GLuint shaderObj) if (!sh) return; + /* set default pragma state for shader */ + sh->Pragmas = ctx->Shader.DefaultPragmas; + /* this call will set the sh->CompileStatus field to indicate if * compilation was successful. */ -- cgit v1.2.3