glsl: Create an accessor for the built-in function shader.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 23 Nov 2013 18:58:51 +0000 (10:58 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 1 Dec 2013 23:33:02 +0000 (15:33 -0800)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/builtin_functions.cpp
src/glsl/ir.h

index 8cb75e5ad6eaa3391c35d948a33996e17d95ec8f..e768685d0a69088a8e8eb340c1e03b4f0371e9da 100644 (file)
@@ -357,8 +357,6 @@ public:
    ir_function_signature *find(_mesa_glsl_parse_state *state,
                                const char *name, exec_list *actual_parameters);
 
-private:
-   void *mem_ctx;
    /**
     * A shader to hold all the built-in signatures; created by this module.
     *
@@ -368,6 +366,9 @@ private:
     */
    gl_shader *shader;
 
+private:
+   void *mem_ctx;
+
    /** Global variables used by built-in functions. */
    ir_variable *gl_ModelViewProjectionMatrix;
    ir_variable *gl_Vertex;
@@ -4020,4 +4021,11 @@ _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state,
 {
    return builtins.find(state, name, actual_parameters);
 }
+
+gl_shader *
+_mesa_glsl_get_builtin_function_shader()
+{
+   return builtins.shader;
+}
+
 /** @} */
index b898d619b3eaf9b61490f3db8f0b6e8d516e07df..57f3bcac026df32390c645eb5ae93338a5593eab 100644 (file)
@@ -2366,6 +2366,9 @@ extern ir_function_signature *
 _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state,
                                  const char *name, exec_list *actual_parameters);
 
+extern gl_shader *
+_mesa_glsl_get_builtin_function_shader(void);
+
 extern void
 _mesa_glsl_release_functions(void);