Add EmitHighLevelInstructions, EmitComments booleans to gl_shader_state.
These control code generation options. May be overridden by drivers, debuggers, etc.
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 70ceb70..48ba8b6 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -196,16 +196,20 @@
}
+/**
+ * Initialize context's shader state.
+ */
void
_mesa_init_shader_state(GLcontext * ctx)
{
- /* no-op */
+ /* Device drivers may override these to control what kind of instructions
+ * are generated by the GLSL compiler.
+ */
+ ctx->Shader.EmitHighLevelInstructions = GL_TRUE;
+ ctx->Shader.EmitComments = GL_FALSE;
}
-
-
-
/**
* Copy string from <src> to <dst>, up to maxLength characters, returning
* length of <dst> in <length>.
@@ -227,8 +231,6 @@
}
-
-
/**
* Called via ctx->Driver.AttachShader()
*/