summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/shader_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-03-19 10:25:24 -0600
committerBrian Paul <[email protected]>2009-03-19 10:29:13 -0600
commit65fc2ca82a38bc00ae4223124932af6771765041 (patch)
tree07d7a4b23f2e2d86af8131970df47780aa7f040a /src/mesa/shader/shader_api.c
parenta57d7edf069d1d161a45825021a7cf4d825fb88f (diff)
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.
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r--src/mesa/shader/shader_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 9900acc75b4..61289db2d2e 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.
*/