Eric Anholt
5ba9420608
Add an ir_if simplification pass.
...
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.
2010-04-14 17:05:13 -07:00
Eric Anholt
2a7b2b22f4
Repeat the optimization passes until we stop making progress.
2010-04-08 13:43:56 -07:00
Eric Anholt
cad9766118
Inline functions consisting of a return of an expression.
2010-04-08 11:24:06 -07:00
Ian Romanick
0c82465395
Treat texture rectangles as an extension that is enabled be default
2010-04-07 17:13:44 -07:00
Ian Romanick
c77b257094
Add support for GL_ARB_draw_buffers extension
2010-04-07 16:59:46 -07:00
Ian Romanick
887a8b07de
Clean up error reporting in _mesa_glsl_process_extension
2010-04-07 16:57:56 -07:00
Ian Romanick
1799a0cd41
Emit a warning when an unknown extension is used with #extension
2010-04-07 16:49:25 -07:00
Ian Romanick
56b8b21410
Add _mesa_glsl_warning to emit warnings to the shader log
2010-04-07 16:49:25 -07:00
Ian Romanick
e701761cc8
Begin processing #extension directive
...
Nowhere near complete. It just parses correctly at this point.
2010-04-07 16:49:25 -07:00
Ian Romanick
5bfe30a02b
Add utility function to get the name of a shader target
2010-04-07 16:49:25 -07:00
Ian Romanick
e9d0f265aa
Begin tracking the nesting of loops and switch-statements
2010-04-07 11:42:36 -07:00
Eric Anholt
70b74928a2
Make constant folding descend into if statements.
2010-04-06 11:52:09 -07:00
Eric Anholt
62735694a1
Add a constant folding optimization pass.
2010-04-06 11:42:31 -07:00
Ian Romanick
03d3f3ab71
Remove ast_node::type
...
It isn't a type (is was enum specifying the kind of node), it was
unused, and it was easily confused with actual type fields. Kill with fire.
2010-04-02 11:05:16 -07:00
Ian Romanick
92318a9479
Add ast_function::hir
...
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
2010-03-31 18:23:21 -07:00
Ian Romanick
5185a5f7d5
Add generate_temporary to generate an anonymous temporary
2010-03-29 15:20:42 -07:00
Ian Romanick
d14642739e
IR print visitor: Remove most of the newlines from the printed output
...
This makes it a lot easier to read... if you have a really wide display.
2010-03-25 18:40:48 -07:00
Eric Anholt
7c15bb2465
Make the standalone parser return an exit code so we can automate testing.
2010-03-25 14:37:25 -07:00
Ian Romanick
71d0bbfcb2
Disallow passing NULL for state to _mesa_glsl_error
...
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.
2010-03-23 13:21:19 -07:00
Ian Romanick
8bde4cec6b
Use glsl_symbol_table instead of using _mesa_symbol_table directly
2010-03-19 11:57:24 -07:00
Ian Romanick
bbddcb3092
Factor ast_type_specifier code out to ast_type.cpp
2010-03-15 14:09:23 -07:00
Ian Romanick
1f58518059
Track generation of errors and halt compilation appropriately
2010-03-11 14:08:33 -08:00
Ian Romanick
d949a9afb0
Move top-level AST to HIR conversion to _mesa_ast_to_hir
2010-03-10 09:55:22 -08:00
Ian Romanick
8e6cd3bf54
Require the shader target be specified to the driver program
2010-03-10 09:31:30 -08:00
Ian Romanick
1c4156ffac
Use ir_print_visitor to dump IR tree
2010-03-10 09:27:03 -08:00
Ian Romanick
0044e7edce
Conver IR structures to use exec_list instead of simple_node
2010-03-08 23:44:54 -08:00
Ian Romanick
18238de6c3
Make AST->HIR conversion a method of ast_node, re-enable
2010-03-01 13:49:10 -08:00
Ian Romanick
d59673c9de
autoconf for the ...
2010-02-25 17:17:23 -08:00
Ian Romanick
e41a1cd4d5
Replace tacky wrapper macros with tacky in-line type-casts
2010-02-25 12:49:55 -08:00
Ian Romanick
88349b22ca
Add ast_expression_bin subclass of ast_expression
...
The ast_expression_bin subclass is used for all binary expressions
such as addition, subtraction, and comparisons. Several other
subclasses are soon to follow.
2010-02-22 19:10:25 -08:00
Ian Romanick
d5f4f09e76
Rename .cc files to .cpp
2010-02-22 18:43:08 -08:00