From: Kenneth Graunke Date: Sat, 23 Nov 2013 18:58:51 +0000 (-0800) Subject: glsl: Create an accessor for the built-in function shader. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b557b1606ffcf05d2612d66226306e876b6b937;p=mesa.git glsl: Create an accessor for the built-in function shader. Signed-off-by: Kenneth Graunke Reviewed-by: Ian Romanick --- diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index 8cb75e5ad6e..e768685d0a6 100644 --- a/src/glsl/builtin_functions.cpp +++ b/src/glsl/builtin_functions.cpp @@ -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; +} + /** @} */ diff --git a/src/glsl/ir.h b/src/glsl/ir.h index b898d619b3e..57f3bcac026 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -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);