aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_symbol_table.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add ir_var_shader_storageKristian Høgsberg2015-07-141-5/+11
| | | | | | | | | | | This will be used to identify buffer variables inside shader storage buffer objects, which are very similar to uniforms except for a few differences, most important of which is that they are writable. Since buffer variables are so similar to uniforms, we will almost always want them to go through the same paths as uniforms. Reviewed-by: Jordan Justen <[email protected]>
* glsl: Never put ir_var_temporary variables in the symbol tableIan Romanick2014-09-301-0/+2
| | | | | | | | | | | Later patches will give every ir_var_temporary the same name in release builds. Adding a bunch of variables named "compiler_temp" to the symbol table can only cause problems. No change Valgrind massif results for a trimmed apitrace of dota2. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: remove {add,get}_type_ast from glsl_symbol_tableChia-I Wu2014-03-281-25/+0
| | | | | | | They are not needed since 0da1a2cc369052643ccaea75a1722cc37652d82a. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Make it possible to disable a variable in the symbol table.Paul Berry2013-10-101-0/+15
| | | | | | | | | | | | | In later patches, we'll use this in order to implement the required behaviour that after the gl_PerVertex interface block has been redeclared, only members of the redeclared interface block may be used. v2: Update the function name and comment to clarify that we aren't actually removing the variable from the symbol table, just disabling it. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS in a bunch of places.Kenneth Graunke2013-09-211-14/+1
| | | | | | | | | This eliminates a lot of boilerplate and should be 100% equivalent. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Avoid variable length arrays.José Fonseca2013-07-121-7/+14
| | | | | | | | | They are a non-standard GCC extension that's not widely supported by other C/C++ compilers. Use a dynamic array instead. Trivial. Should fix the MSVC build.
* glsl: Track structs' ast_type_specifiers in symbol table.Matt Turner2013-07-111-4/+25
| | | | | | | | | Will be used in a future commit. An ast_type_specifier is stored (rather than an ast_struct_specifier) with the idea that we may have more general uses for this in the future. struct names are prefixed with '#ast.' to avoid collisions with the glsl_types in the symbol table. Reviewed-by: Ian Romanick <[email protected]>
* glsl_symbol_table: add interface block namespacesJordan Justen2013-05-231-3/+81
| | | | | | | | For interface blocks, there are three separate namespaces for uniform, input and output blocks. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Track blocks in the symbol table using the glsl_type instead of the ↵Ian Romanick2013-01-251-11/+3
| | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Track UBO block names in the symbol table.Kenneth Graunke2013-01-181-3/+11
| | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* glsl: Simplify symbol table version checking.Paul Berry2012-12-061-3/+3
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl2: Silence unused added variable gcc warning.José Fonseca2011-03-161-0/+1
|
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-7/+7
|
* glsl: Don't bother unsetting a destructor that was never set.Kenneth Graunke2011-01-191-6/+3
| | | | This was totally copied and pasted from glsl_symbol_table.
* glsl: Properly add functions during lazy built-in prototype importing.Kenneth Graunke2010-12-061-0/+7
| | | | | | | | | | | | 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.
* glsl: Make the symbol table's add_variable just use the variable's name.Eric Anholt2010-11-291-5/+5
|
* glsl: Make the symbol table's add_function just use the function's name.Eric Anholt2010-11-291-4/+4
|
* glsl2: Remove unnecessary glsl_symbol_table::get_function parameter ↵Ian Romanick2010-09-011-7/+2
| | | | | | | | 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.
* glsl2: Remove unused 'constructor' parameter from glsl_symbol_table::add_typeIan Romanick2010-09-011-4/+3
|
* glsl2: Don't generate constructor functions for structuresIan Romanick2010-09-011-1/+1
|
* glsl: Silence unused variable warning.José Fonseca2010-08-301-0/+1
|
* glsl: Don't add overloads to existing structure constructors.Kenneth Graunke2010-08-261-2/+7
| | | | | | Instead, make a new ir_function and try to add it to the symbol table. Fixes piglit test redeclaration-08.vert.
* glsl: Use a single shared namespace in the symbol table.Kenneth Graunke2010-08-261-0/+160
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.