This is necessary so _mesa_glsl_initialize_types can create appropriate
glsl_types and add them to the symbol table.
In the future, we'll want to set it to the max GLSL version supported by
the current driver.
Among other things, this ensures that all of the extension flags are
initially disabled.
This causes the following tests to pass:
glslparsertest/glsl2/draw_buffers-02.frag
The missing else-statements caused all of the extensions execpt
GL_ARB_texture_rectangle to be unsupported.
This causes the following tests to pass:
glslparsertest/glsl2/draw_buffers-04.frag
This pass only works on assignments where the variable is never
referenced. There is no code flow analysis, so it can't do a better
job of avoiding redundant assignments.
For now, the optimizer only does do_dead_code_unlinked(), so it won't
trim the builtin variable list or initializers outside of the scope of
functions. This is because we don't have the visibility into other
functions that might get linked in in order to eliminate work on
global variables.
This is relatively simple at the moment, recognizing only constant
values, and not (for example) values that are restricted to a range
that make the branching constant. However, it does remove 59 lines
from the printout of CorrectParse2.vert.
ast_function::hir consists of bits pulled out of
ast_function_definition::hir. In fact, the later uses the former to
do a lot of its processing. Several class private data fields were
added to ast_function to facilitate communicate between the two.
This causes the following tests to pass:
glslparsertest/shaders/CorrectModule.frag
This causes the following tests to fail. These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.
glslparsertest/shaders/function9.frag
glslparsertest/shaders/function10.frag
The two places that were still passing NULL had a state pointer to
pass. Not passing it in these places prevented termination of
compilation of erroneous programs.
The ast_expression_bin subclass is used for all binary expressions
such as addition, subtraction, and comparisons. Several other
subclasses are soon to follow.