summaryrefslogtreecommitdiff
path: root/src/glsl/glsl_symbol_table.h
AgeCommit message (Collapse)AuthorFilesLines
2013-01-25glsl: Track blocks in the symbol table using the glsl_type instead of the ↵Ian Romanick1-1/+0
gl_uniform_block Eventually the gl_uniform_block information won't be calculated until linking. Block names need to be checked for name clashes during compiling, so we have to track it differently. v2: Update the commit message. Suggested by Carl Worth. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18glsl: Track UBO block names in the symbol table.Kenneth Graunke1-0/+1
The GLSL 1.40 spec says: "Uniform block names and variable names declared within uniform blocks are scoped at the program level." Track the block name in the symbol table and emit errors when conflicts exist. Fixes es3conform's uniform_buffer_object_block_name_conflict test, and fixes the piglit block-name-clashes-with-{variable,function,struct}.vert tests. NOTE: This is a candidate for the 9.0 branch. v2: Fix bad constructor initialization. Noticed by Topi Pohjolainen. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-06glsl: Simplify symbol table version checking.Paul Berry1-1/+2
Previously, we stored the GLSL language version in the glsl_symbol_table struct. But this was unnecessary--all glsl_symbol_table needs to know is whether functions and variables have separate namespaces (they do in GLSL 1.10 only). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Carl Worth <cworth@cworth.org>
2011-01-31Convert everything from the talloc API to the ralloc API.Kenneth Graunke1-11/+9
2010-12-06glsl: Properly add functions during lazy built-in prototype importing.Kenneth Graunke1-0/+5
The original lazy built-in importing patch did not add the newly created function to the symbol table, nor actually emit it into the IR stream. Adding it to the symbol table is non-trivial since importing occurs when generating some ir_call in a nested scope. A new add_global_function method, backed by new symbol_table code in the previous patch, handles this. Fixes bug #32030.
2010-11-29glsl: Make the symbol table's add_variable just use the variable's name.Eric Anholt1-1/+1
2010-11-29glsl: Make the symbol table's add_function just use the function's name.Eric Anholt1-1/+1
2010-09-01glsl2: Remove unnecessary glsl_symbol_table::get_function parameter ↵Ian Romanick1-1/+1
return_constructors Now that constructors are not generated as functions or stored in the symbol table, there is no need to flag whether or not constructors should be returned.
2010-09-01glsl2: Remove unused 'constructor' parameter from glsl_symbol_table::add_typeIan Romanick1-2/+1
2010-08-26glsl: Don't add overloads to existing structure constructors.Kenneth Graunke1-1/+1
Instead, make a new ir_function and try to add it to the symbol table. Fixes piglit test redeclaration-08.vert.
2010-08-26glsl: Use a single shared namespace in the symbol table.Kenneth Graunke1-67/+18
As of 1.20, variable names, function names, and structure type names all share a single namespace, and should conflict with one another in the same scope, or hide each other in nested scopes. However, in 1.10, variables and functions can share the same name in the same scope. Structure types, however, conflict with/hide both. Fixes piglit tests redeclaration-06.vert, redeclaration-11.vert, redeclaration-19.vert, and struct-05.vert.
2010-08-14glsl: Standardize a few more uses of struct vs class keyword.José Fonseca1-1/+1
2010-08-05glsl2: Add a pass for removing unused functions.Eric Anholt1-0/+6
For a shader involving many small functions, this avoids running optimization across all of them after they've been inlined post-linking. Reduces the runtime of linking and running a fragment shader from Yo Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
2010-07-26Merge remote branch 'origin/master' into glsl2Eric Anholt1-1/+1
This pulls in multiple i965 driver fixes which will help ensure better testing coverage during development, and also gets past the conflicts of the src/mesa/shader -> src/mesa/program move. Conflicts: src/mesa/Makefile src/mesa/main/shaderapi.c src/mesa/main/shaderobj.h
2010-06-24glsl2: Wrap includes of C interfaces with extern "C".Eric Anholt1-0/+2
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt1-0/+163