2 * Copyright © 2008, 2009 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
29 #include "main/core.h" /* for struct gl_context */
34 #include "glsl_parser_extras.h"
35 #include "glsl_parser.h"
36 #include "ir_optimization.h"
37 #include "loop_analysis.h"
39 _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context
*ctx
,
40 GLenum target
, void *mem_ctx
)
43 case GL_VERTEX_SHADER
: this->target
= vertex_shader
; break;
44 case GL_FRAGMENT_SHADER
: this->target
= fragment_shader
; break;
45 case GL_GEOMETRY_SHADER
: this->target
= geometry_shader
; break;
49 this->translation_unit
.make_empty();
50 this->symbols
= new(mem_ctx
) glsl_symbol_table
;
51 this->info_log
= ralloc_strdup(mem_ctx
, "");
53 this->loop_nesting_ast
= NULL
;
54 this->switch_nesting_ast
= NULL
;
56 this->num_builtins_to_link
= 0;
58 /* Set default language version and extensions */
59 this->language_version
= 110;
60 this->es_shader
= false;
61 this->ARB_texture_rectangle_enable
= true;
63 /* OpenGL ES 2.0 has different defaults from desktop GL. */
64 if (ctx
->API
== API_OPENGLES2
) {
65 this->language_version
= 100;
66 this->es_shader
= true;
67 this->ARB_texture_rectangle_enable
= false;
70 this->extensions
= &ctx
->Extensions
;
72 this->Const
.MaxLights
= ctx
->Const
.MaxLights
;
73 this->Const
.MaxClipPlanes
= ctx
->Const
.MaxClipPlanes
;
74 this->Const
.MaxTextureUnits
= ctx
->Const
.MaxTextureUnits
;
75 this->Const
.MaxTextureCoords
= ctx
->Const
.MaxTextureCoordUnits
;
76 this->Const
.MaxVertexAttribs
= ctx
->Const
.VertexProgram
.MaxAttribs
;
77 this->Const
.MaxVertexUniformComponents
= ctx
->Const
.VertexProgram
.MaxUniformComponents
;
78 this->Const
.MaxVaryingFloats
= ctx
->Const
.MaxVarying
* 4;
79 this->Const
.MaxVertexTextureImageUnits
= ctx
->Const
.MaxVertexTextureImageUnits
;
80 this->Const
.MaxCombinedTextureImageUnits
= ctx
->Const
.MaxCombinedTextureImageUnits
;
81 this->Const
.MaxTextureImageUnits
= ctx
->Const
.MaxTextureImageUnits
;
82 this->Const
.MaxFragmentUniformComponents
= ctx
->Const
.FragmentProgram
.MaxUniformComponents
;
84 this->Const
.MaxDrawBuffers
= ctx
->Const
.MaxDrawBuffers
;
86 /* Note: Once the OpenGL 3.0 'forward compatible' context or the OpenGL 3.2
87 * Core context is supported, this logic will need change. Older versions of
88 * GLSL are no longer supported outside the compatibility contexts of 3.x.
90 this->Const
.GLSL_100ES
= (ctx
->API
== API_OPENGLES2
)
91 || ctx
->Extensions
.ARB_ES2_compatibility
;
92 this->Const
.GLSL_110
= (ctx
->API
== API_OPENGL
);
93 this->Const
.GLSL_120
= (ctx
->API
== API_OPENGL
)
94 && (ctx
->Const
.GLSLVersion
>= 120);
95 this->Const
.GLSL_130
= (ctx
->API
== API_OPENGL
)
96 && (ctx
->Const
.GLSLVersion
>= 130);
98 const unsigned lowest_version
=
99 (ctx
->API
== API_OPENGLES2
) || ctx
->Extensions
.ARB_ES2_compatibility
101 const unsigned highest_version
=
102 (ctx
->API
== API_OPENGL
) ? ctx
->Const
.GLSLVersion
: 100;
103 char *supported
= ralloc_strdup(this, "");
105 for (unsigned ver
= lowest_version
; ver
<= highest_version
; ver
+= 10) {
106 const char *const prefix
= (ver
== lowest_version
)
108 : ((ver
== highest_version
) ? ", and " : ", ");
110 ralloc_asprintf_append(& supported
, "%s%d.%02d%s",
112 ver
/ 100, ver
% 100,
113 (ver
== 100) ? " ES" : "");
116 this->supported_version_string
= supported
;
120 _mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target
)
123 case vertex_shader
: return "vertex";
124 case fragment_shader
: return "fragment";
125 case geometry_shader
: return "geometry";
128 assert(!"Should not get here.");
134 _mesa_glsl_error(YYLTYPE
*locp
, _mesa_glsl_parse_state
*state
,
135 const char *fmt
, ...)
141 assert(state
->info_log
!= NULL
);
142 ralloc_asprintf_append(&state
->info_log
, "%u:%u(%u): error: ",
147 ralloc_vasprintf_append(&state
->info_log
, fmt
, ap
);
149 ralloc_strcat(&state
->info_log
, "\n");
154 _mesa_glsl_warning(const YYLTYPE
*locp
, _mesa_glsl_parse_state
*state
,
155 const char *fmt
, ...)
159 assert(state
->info_log
!= NULL
);
160 ralloc_asprintf_append(&state
->info_log
, "%u:%u(%u): warning: ",
165 ralloc_vasprintf_append(&state
->info_log
, fmt
, ap
);
167 ralloc_strcat(&state
->info_log
, "\n");
172 * Enum representing the possible behaviors that can be specified in
173 * an #extension directive.
183 * Element type for _mesa_glsl_supported_extensions
185 struct _mesa_glsl_extension
{
187 * Name of the extension when referred to in a GLSL extension
192 /** True if this extension is available to vertex shaders */
195 /** True if this extension is available to geometry shaders */
198 /** True if this extension is available to fragment shaders */
201 /** True if this extension is available to desktop GL shaders */
204 /** True if this extension is available to GLES shaders */
208 * Flag in the gl_extensions struct indicating whether this
209 * extension is supported by the driver, or
210 * &gl_extensions::dummy_true if supported by all drivers.
212 * Note: the type (GLboolean gl_extensions::*) is a "pointer to
213 * member" type, the type-safe alternative to the "offsetof" macro.
216 * - foo bar::* p declares p to be an "offset" to a field of type
217 * foo that exists within struct bar
218 * - &bar::baz computes the "offset" of field baz within struct bar
219 * - x.*p accesses the field of x that exists at "offset" p
220 * - x->*p is equivalent to (*x).*p
222 const GLboolean
gl_extensions::* supported_flag
;
225 * Flag in the _mesa_glsl_parse_state struct that should be set
226 * when this extension is enabled.
228 * See note in _mesa_glsl_extension::supported_flag about "pointer
231 bool _mesa_glsl_parse_state::* enable_flag
;
234 * Flag in the _mesa_glsl_parse_state struct that should be set
235 * when the shader requests "warn" behavior for this extension.
237 * See note in _mesa_glsl_extension::supported_flag about "pointer
240 bool _mesa_glsl_parse_state::* warn_flag
;
243 bool compatible_with_state(const _mesa_glsl_parse_state
*state
) const;
244 void set_flags(_mesa_glsl_parse_state
*state
, ext_behavior behavior
) const;
247 #define EXT(NAME, VS, GS, FS, GL, ES, SUPPORTED_FLAG) \
248 { "GL_" #NAME, VS, GS, FS, GL, ES, &gl_extensions::SUPPORTED_FLAG, \
249 &_mesa_glsl_parse_state::NAME##_enable, \
250 &_mesa_glsl_parse_state::NAME##_warn }
253 * Table of extensions that can be enabled/disabled within a shader,
254 * and the conditions under which they are supported.
256 static const _mesa_glsl_extension _mesa_glsl_supported_extensions
[] = {
257 /* target availability API availability */
258 /* name VS GS FS GL ES supported flag */
259 EXT(ARB_conservative_depth
, false, false, true, true, false, ARB_conservative_depth
),
260 EXT(ARB_draw_buffers
, false, false, true, true, false, dummy_true
),
261 EXT(ARB_draw_instanced
, true, false, false, true, false, ARB_draw_instanced
),
262 EXT(ARB_explicit_attrib_location
, true, false, true, true, false, ARB_explicit_attrib_location
),
263 EXT(ARB_fragment_coord_conventions
, true, false, true, true, false, ARB_fragment_coord_conventions
),
264 EXT(ARB_texture_rectangle
, true, false, true, true, false, dummy_true
),
265 EXT(EXT_texture_array
, true, false, true, true, false, EXT_texture_array
),
266 EXT(ARB_shader_texture_lod
, true, false, true, true, false, ARB_shader_texture_lod
),
267 EXT(ARB_shader_stencil_export
, false, false, true, true, false, ARB_shader_stencil_export
),
268 EXT(AMD_conservative_depth
, false, false, true, true, false, ARB_conservative_depth
),
269 EXT(AMD_shader_stencil_export
, false, false, true, true, false, ARB_shader_stencil_export
),
270 EXT(OES_texture_3D
, true, false, true, false, true, EXT_texture3D
),
271 EXT(OES_EGL_image_external
, true, false, true, false, true, OES_EGL_image_external
),
278 * Determine whether a given extension is compatible with the target,
279 * API, and extension information in the current parser state.
281 bool _mesa_glsl_extension::compatible_with_state(const _mesa_glsl_parse_state
*
284 /* Check that this extension matches the type of shader we are
287 switch (state
->target
) {
289 if (!this->avail_in_VS
) {
293 case geometry_shader
:
294 if (!this->avail_in_GS
) {
298 case fragment_shader
:
299 if (!this->avail_in_FS
) {
304 assert (!"Unrecognized shader target");
308 /* Check that this extension matches whether we are compiling
309 * for desktop GL or GLES.
311 if (state
->es_shader
) {
312 if (!this->avail_in_ES
) return false;
314 if (!this->avail_in_GL
) return false;
317 /* Check that this extension is supported by the OpenGL
320 * Note: the ->* operator indexes into state->extensions by the
321 * offset this->supported_flag. See
322 * _mesa_glsl_extension::supported_flag for more info.
324 return state
->extensions
->*(this->supported_flag
);
328 * Set the appropriate flags in the parser state to establish the
329 * given behavior for this extension.
331 void _mesa_glsl_extension::set_flags(_mesa_glsl_parse_state
*state
,
332 ext_behavior behavior
) const
334 /* Note: the ->* operator indexes into state by the
335 * offsets this->enable_flag and this->warn_flag. See
336 * _mesa_glsl_extension::supported_flag for more info.
338 state
->*(this->enable_flag
) = (behavior
!= extension_disable
);
339 state
->*(this->warn_flag
) = (behavior
== extension_warn
);
343 * Find an extension by name in _mesa_glsl_supported_extensions. If
344 * the name is not found, return NULL.
346 static const _mesa_glsl_extension
*find_extension(const char *name
)
348 for (unsigned i
= 0; i
< Elements(_mesa_glsl_supported_extensions
); ++i
) {
349 if (strcmp(name
, _mesa_glsl_supported_extensions
[i
].name
) == 0) {
350 return &_mesa_glsl_supported_extensions
[i
];
358 _mesa_glsl_process_extension(const char *name
, YYLTYPE
*name_locp
,
359 const char *behavior_string
, YYLTYPE
*behavior_locp
,
360 _mesa_glsl_parse_state
*state
)
362 ext_behavior behavior
;
363 if (strcmp(behavior_string
, "warn") == 0) {
364 behavior
= extension_warn
;
365 } else if (strcmp(behavior_string
, "require") == 0) {
366 behavior
= extension_require
;
367 } else if (strcmp(behavior_string
, "enable") == 0) {
368 behavior
= extension_enable
;
369 } else if (strcmp(behavior_string
, "disable") == 0) {
370 behavior
= extension_disable
;
372 _mesa_glsl_error(behavior_locp
, state
,
373 "Unknown extension behavior `%s'",
378 if (strcmp(name
, "all") == 0) {
379 if ((behavior
== extension_enable
) || (behavior
== extension_require
)) {
380 _mesa_glsl_error(name_locp
, state
, "Cannot %s all extensions",
381 (behavior
== extension_enable
)
382 ? "enable" : "require");
386 i
< Elements(_mesa_glsl_supported_extensions
); ++i
) {
387 const _mesa_glsl_extension
*extension
388 = &_mesa_glsl_supported_extensions
[i
];
389 if (extension
->compatible_with_state(state
)) {
390 _mesa_glsl_supported_extensions
[i
].set_flags(state
, behavior
);
395 const _mesa_glsl_extension
*extension
= find_extension(name
);
396 if (extension
&& extension
->compatible_with_state(state
)) {
397 extension
->set_flags(state
, behavior
);
399 static const char *const fmt
= "extension `%s' unsupported in %s shader";
401 if (behavior
== extension_require
) {
402 _mesa_glsl_error(name_locp
, state
, fmt
,
403 name
, _mesa_glsl_shader_target_name(state
->target
));
406 _mesa_glsl_warning(name_locp
, state
, fmt
,
407 name
, _mesa_glsl_shader_target_name(state
->target
));
416 _mesa_ast_type_qualifier_print(const struct ast_type_qualifier
*q
)
418 if (q
->flags
.q
.constant
)
421 if (q
->flags
.q
.invariant
)
422 printf("invariant ");
424 if (q
->flags
.q
.attribute
)
425 printf("attribute ");
427 if (q
->flags
.q
.varying
)
430 if (q
->flags
.q
.in
&& q
->flags
.q
.out
)
440 if (q
->flags
.q
.centroid
)
442 if (q
->flags
.q
.uniform
)
444 if (q
->flags
.q
.smooth
)
448 if (q
->flags
.q
.noperspective
)
449 printf("noperspective ");
454 ast_node::print(void) const
456 printf("unhandled node ");
460 ast_node::ast_node(void)
462 this->location
.source
= 0;
463 this->location
.line
= 0;
464 this->location
.column
= 0;
469 ast_opt_array_size_print(bool is_array
, const ast_expression
*array_size
)
483 ast_compound_statement::print(void) const
487 foreach_list_const(n
, &this->statements
) {
488 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
496 ast_compound_statement::ast_compound_statement(int new_scope
,
497 ast_node
*statements
)
499 this->new_scope
= new_scope
;
501 if (statements
!= NULL
) {
502 this->statements
.push_degenerate_list_at_head(&statements
->link
);
508 ast_expression::print(void) const
522 subexpressions
[0]->print();
523 printf("%s ", operator_string(oper
));
524 subexpressions
[1]->print();
527 case ast_field_selection
:
528 subexpressions
[0]->print();
529 printf(". %s ", primary_expression
.identifier
);
538 printf("%s ", operator_string(oper
));
539 subexpressions
[0]->print();
544 subexpressions
[0]->print();
545 printf("%s ", operator_string(oper
));
548 case ast_conditional
:
549 subexpressions
[0]->print();
551 subexpressions
[1]->print();
553 subexpressions
[2]->print();
556 case ast_array_index
:
557 subexpressions
[0]->print();
559 subexpressions
[1]->print();
563 case ast_function_call
: {
564 subexpressions
[0]->print();
567 foreach_list_const (n
, &this->expressions
) {
568 if (n
!= this->expressions
.get_head())
571 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
580 printf("%s ", primary_expression
.identifier
);
583 case ast_int_constant
:
584 printf("%d ", primary_expression
.int_constant
);
587 case ast_uint_constant
:
588 printf("%u ", primary_expression
.uint_constant
);
591 case ast_float_constant
:
592 printf("%f ", primary_expression
.float_constant
);
595 case ast_bool_constant
:
597 primary_expression
.bool_constant
603 foreach_list_const(n
, & this->expressions
) {
604 if (n
!= this->expressions
.get_head())
607 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
620 ast_expression::ast_expression(int oper
,
625 this->oper
= ast_operators(oper
);
626 this->subexpressions
[0] = ex0
;
627 this->subexpressions
[1] = ex1
;
628 this->subexpressions
[2] = ex2
;
633 ast_expression_statement::print(void) const
642 ast_expression_statement::ast_expression_statement(ast_expression
*ex
) :
650 ast_function::print(void) const
652 return_type
->print();
653 printf(" %s (", identifier
);
655 foreach_list_const(n
, & this->parameters
) {
656 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
664 ast_function::ast_function(void)
665 : is_definition(false), signature(NULL
)
672 ast_fully_specified_type::print(void) const
674 _mesa_ast_type_qualifier_print(& qualifier
);
680 ast_parameter_declarator::print(void) const
684 printf("%s ", identifier
);
685 ast_opt_array_size_print(is_array
, array_size
);
690 ast_function_definition::print(void) const
698 ast_declaration::print(void) const
700 printf("%s ", identifier
);
701 ast_opt_array_size_print(is_array
, array_size
);
705 initializer
->print();
710 ast_declaration::ast_declaration(char *identifier
, int is_array
,
711 ast_expression
*array_size
,
712 ast_expression
*initializer
)
714 this->identifier
= identifier
;
715 this->is_array
= is_array
;
716 this->array_size
= array_size
;
717 this->initializer
= initializer
;
722 ast_declarator_list::print(void) const
724 assert(type
|| invariant
);
729 printf("invariant ");
731 foreach_list_const (ptr
, & this->declarations
) {
732 if (ptr
!= this->declarations
.get_head())
735 ast_node
*ast
= exec_node_data(ast_node
, ptr
, link
);
743 ast_declarator_list::ast_declarator_list(ast_fully_specified_type
*type
)
746 this->invariant
= false;
750 ast_jump_statement::print(void) const
754 printf("continue; ");
761 if (opt_return_value
)
762 opt_return_value
->print();
773 ast_jump_statement::ast_jump_statement(int mode
, ast_expression
*return_value
)
775 this->mode
= ast_jump_modes(mode
);
777 if (mode
== ast_return
)
778 opt_return_value
= return_value
;
783 ast_selection_statement::print(void) const
789 then_statement
->print();
791 if (else_statement
) {
793 else_statement
->print();
799 ast_selection_statement::ast_selection_statement(ast_expression
*condition
,
800 ast_node
*then_statement
,
801 ast_node
*else_statement
)
803 this->condition
= condition
;
804 this->then_statement
= then_statement
;
805 this->else_statement
= else_statement
;
810 ast_switch_statement::print(void) const
813 test_expression
->print();
820 ast_switch_statement::ast_switch_statement(ast_expression
*test_expression
,
823 this->test_expression
= test_expression
;
829 ast_switch_body::print(void) const
839 ast_switch_body::ast_switch_body(ast_case_statement_list
*stmts
)
845 void ast_case_label::print(void) const
847 if (test_value
!= NULL
) {
857 ast_case_label::ast_case_label(ast_expression
*test_value
)
859 this->test_value
= test_value
;
863 void ast_case_label_list::print(void) const
865 foreach_list_const(n
, & this->labels
) {
866 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
873 ast_case_label_list::ast_case_label_list(void)
878 void ast_case_statement::print(void) const
881 foreach_list_const(n
, & this->stmts
) {
882 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
889 ast_case_statement::ast_case_statement(ast_case_label_list
*labels
)
891 this->labels
= labels
;
895 void ast_case_statement_list::print(void) const
897 foreach_list_const(n
, & this->cases
) {
898 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
904 ast_case_statement_list::ast_case_statement_list(void)
910 ast_iteration_statement::print(void) const
916 init_statement
->print();
924 rest_expression
->print();
950 ast_iteration_statement::ast_iteration_statement(int mode
,
953 ast_expression
*rest_expression
,
956 this->mode
= ast_iteration_modes(mode
);
957 this->init_statement
= init
;
958 this->condition
= condition
;
959 this->rest_expression
= rest_expression
;
965 ast_struct_specifier::print(void) const
967 printf("struct %s { ", name
);
968 foreach_list_const(n
, &this->declarations
) {
969 ast_node
*ast
= exec_node_data(ast_node
, n
, link
);
976 ast_struct_specifier::ast_struct_specifier(char *identifier
,
977 ast_node
*declarator_list
)
979 if (identifier
== NULL
) {
980 static unsigned anon_count
= 1;
981 identifier
= ralloc_asprintf(this, "#anon_struct_%04x", anon_count
);
985 this->declarations
.push_degenerate_list_at_head(&declarator_list
->link
);
989 * Do the set of common optimizations passes
991 * \param ir List of instructions to be optimized
992 * \param linked Is the shader linked? This enables
993 * optimizations passes that remove code at
994 * global scope and could cause linking to
996 * \param uniform_locations_assigned Have locations already been assigned for
997 * uniforms? This prevents the declarations
998 * of unused uniforms from being removed.
999 * The setting of this flag only matters if
1000 * \c linked is \c true.
1001 * \param max_unroll_iterations Maximum number of loop iterations to be
1002 * unrolled. Setting to 0 forces all loops
1006 do_common_optimization(exec_list
*ir
, bool linked
,
1007 bool uniform_locations_assigned
,
1008 unsigned max_unroll_iterations
)
1010 GLboolean progress
= GL_FALSE
;
1012 progress
= lower_instructions(ir
, SUB_TO_ADD_NEG
) || progress
;
1015 progress
= do_function_inlining(ir
) || progress
;
1016 progress
= do_dead_functions(ir
) || progress
;
1017 progress
= do_structure_splitting(ir
) || progress
;
1019 progress
= do_if_simplification(ir
) || progress
;
1020 progress
= do_discard_simplification(ir
) || progress
;
1021 progress
= do_copy_propagation(ir
) || progress
;
1022 progress
= do_copy_propagation_elements(ir
) || progress
;
1024 progress
= do_dead_code(ir
, uniform_locations_assigned
) || progress
;
1026 progress
= do_dead_code_unlinked(ir
) || progress
;
1027 progress
= do_dead_code_local(ir
) || progress
;
1028 progress
= do_tree_grafting(ir
) || progress
;
1029 progress
= do_constant_propagation(ir
) || progress
;
1031 progress
= do_constant_variable(ir
) || progress
;
1033 progress
= do_constant_variable_unlinked(ir
) || progress
;
1034 progress
= do_constant_folding(ir
) || progress
;
1035 progress
= do_algebraic(ir
) || progress
;
1036 progress
= do_lower_jumps(ir
) || progress
;
1037 progress
= do_vec_index_to_swizzle(ir
) || progress
;
1038 progress
= do_swizzle_swizzle(ir
) || progress
;
1039 progress
= do_noop_swizzle(ir
) || progress
;
1041 progress
= optimize_redundant_jumps(ir
) || progress
;
1043 loop_state
*ls
= analyze_loop_variables(ir
);
1044 if (ls
->loop_found
) {
1045 progress
= set_loop_controls(ir
, ls
) || progress
;
1046 progress
= unroll_loops(ir
, ls
, max_unroll_iterations
) || progress
;
1056 * To be called at GL teardown time, this frees compiler datastructures.
1058 * After calling this, any previously compiled shaders and shader
1059 * programs would be invalid. So this should happen at approximately
1063 _mesa_destroy_shader_compiler(void)
1065 _mesa_destroy_shader_compiler_caches();
1067 _mesa_glsl_release_types();
1071 * Releases compiler caches to trade off performance for memory.
1073 * Intended to be used with glReleaseShaderCompiler().
1076 _mesa_destroy_shader_compiler_caches(void)
1078 _mesa_glsl_release_functions();