summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_reader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Make the symbol table's add_variable just use the variable's name.Eric Anholt2010-11-291-1/+1
|
* glsl: Make the symbol table's add_function just use the function's name.Eric Anholt2010-11-291-1/+1
|
* ir_reader: Fix some potential NULL pointer dereferences.Kenneth Graunke2010-11-031-4/+4
| | | | Found by inspection.
* ir_reader: Remove useless error check.Kenneth Graunke2010-11-031-6/+0
| | | | | It's already been determined that length == 3, so clearly swiz->next is a valid S-Expression.
* ir_reader: Return a specific ir_dereference variant.Kenneth Graunke2010-11-031-6/+9
| | | | | There's really no reason to return the base class when we have more specific information about what type it is.
* glsl: Move is_builtin flag back to ir_function_signature.Kenneth Graunke2010-09-071-1/+1
| | | | | | | | | | | This effectively reverts b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c. In desktop GLSL, defining a function with the same name as a built-in hides that built-in function completely, so there would never be built-in and user function signatures in the same ir_function. However, in GLSL ES, overloading built-ins is allowed, and does not hide the built-in signatures - so we're back to needing this.
* ir_reader: Only validate IR when a global 'debug' flag is set.Kenneth Graunke2010-09-051-1/+4
| | | | | | | | | This extra validation is very useful when working on the built-ins, but in general overkill - the results should stay the same unless the built-ins or ir_validate have changed. Also, validating all the built-in functions in every test case makes piglit run unacceptably slow.
* ir_reader: Run ir_validate on the generated IR.Kenneth Graunke2010-09-041-0/+2
| | | | It's just too easy to get something wrong in hand-written IR.
* ir_reader: Emit global variables at the top of the instruction list.Kenneth Graunke2010-09-041-2/+11
| | | | | | | | Since functions are emitted when scanning for prototypes, functions always come first, even if the original IR listed the variable declarations first. Fixes an ir_validate error (to be turned on in the next commit).
* ir_reader: Drop support for reading the old assignment format.Kenneth Graunke2010-09-041-6/+4
|
* ir_reader: Read the new assignment format (with write mask).Kenneth Graunke2010-09-041-6/+46
| | | | | This preserves the ability to read the old format, for momentary compatibility with all the existing IR implementations of built-ins.
* ir_reader: Track the current function and report it in error messages.Kenneth Graunke2010-09-041-0/+6
|
* glsl: Initialize data in read_constant.Vinson Lee2010-08-291-1/+1
| | | | | | | Completely initialize data that is passed into a ir_constant constructor. Fixes piglit glsl-fs-mix valgrind uninitialized variable error on softpipe and llvmpipe.
* glsl: Move is_built_in flag from ir_function_signature to ir_function.Kenneth Graunke2010-08-261-1/+1
| | | | | | Also rename it to "is_builtin" for consistency. Signed-off-by: Ian Romanick <[email protected]>
* glsl2: Rework builtin function generation.Kenneth Graunke2010-08-131-8/+16
| | | | | | | | | | | | | | | | Each language version/extension and target now has a "profile" containing all of the available builtin function prototypes. These are written in GLSL, and come directly out of the GLSL spec (except for expanding genType). A new builtins/ir/ folder contains the hand-written IR for each builtin, regardless of what version includes it. Only those definitions that have prototypes in the profile will be included. The autogenerated IR for texture builtins is no longer written to disk, so there's no longer any confusion as to what's hand-written or generated. All scripts are now in python instead of perl.
* ir_reader: Don't mark functions as defined if their body is empty.Kenneth Graunke2010-08-131-1/+1
|
* glsl2: Make ir_assignment derive from ir_instruction, not ir_rvalue.Kenneth Graunke2010-07-221-2/+2
| | | | | | Assignments can only exist at the top level instruction stream; the residual value is handled by assigning the value to a temporary and returning an ir_dereference_variable of that temporary.
* ir_reader: Add support for reading constant arrays.Kenneth Graunke2010-07-211-2/+27
|
* glsl2: glsl_type has its own talloc context, don't pass one inIan Romanick2010-07-201-1/+1
|
* glsl2: Add and use new variable mode ir_var_temporaryIan Romanick2010-07-201-1/+2
| | | | | | | | | | | | | | | | | This is quite a large patch because breaking it into smaller pieces would result in the tree being intermitently broken. The big changes are: * Add the ir_var_temporary variable mode * Change the ir_variable constructor to take the mode as a parameter and correctly specify the mode for all ir_varables. * Change the linker to not cross validate ir_var_temporary variables. * Change the linker to pull all ir_var_temporary variables from global scope into 'main'.
* glsl2: Remove the const disease from function signature's callee.Eric Anholt2010-07-181-1/+1
|
* linker: Implement first bits of intrastage linkingIan Romanick2010-07-121-0/+1
| | | | | | | This currently involves an ugly hack so that every link doesn't result in all the built-in functions showing up as multiply defined. As soon as the built-in functions are stored in a separate compilation unit, ir_function_signature::is_built_in can be removed.
* ir_reader: Don't emit ir_function multiple times.Kenneth Graunke2010-07-071-8/+8
|
* glsl2: Fix for dead strings being stored in the symbol table.Kenneth Graunke2010-07-021-2/+2
|
* glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.Kenneth Graunke2010-06-301-15/+15
| | | | | | | | | | | | | _mesa_glsl_parse_state should be the parent for all temporary allocation done while compiling a shader. glsl_shader should only be used as the parent for the shader's final IR---the _result_ of compilation. Since many IR instructions may be added or discarded during optimization passes, IR should not ever be allocated to glsl_shader directly. Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g. This also removes a ton of talloc_parent calls, which may help performance.
* ir_reader: Free memory for S-Expressions earlier.Kenneth Graunke2010-06-251-2/+2
| | | | | | There's no point in keeping it around once we've read the IR. Also, remove an unnecessary talloc_parent call.
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+1053