summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_clone.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl2: Add cmp field to ir_loopIan Romanick2010-09-031-0/+1
| | | | | This reprents the type of comparison between the loop induction variable and the loop termination value.
* glsl: Move is_built_in flag from ir_function_signature to ir_function.Kenneth Graunke2010-08-261-1/+2
| | | | | | Also rename it to "is_builtin" for consistency. Signed-off-by: Ian Romanick <[email protected]>
* glsl: Silence gcc warning "control reaches end of non-void function".José Fonseca2010-08-141-1/+1
|
* glsl2: Remove the shader_in/shader_out tracking separate from var->mode.Eric Anholt2010-08-041-2/+0
| | | | | | | | | | | | | | | I introduced this for ir_dead_code to distinguish function parameter outvals from varying outputs. Only, since ast_to_hir's current_function is unset when setting up function parameters (they're needed for making the function signature in the first place), all function parameter outvals were marked as shader outputs anyway. This meant that an inlined function's cloned outval was marked as a shader output and couldn't be dead-code eliminated. Instead, since ir_dead_code doesn't even look at function parameters, just use var->mode. The longest Mesa IR coming out of ir_to_mesa for Yo Frankie drops from 725 instructions to 636.
* glsl2: Add ir_assignment::write_mask and associated methodsIan Romanick2010-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Replace swizzles on the LHS with additional swizzles on the RHS and a write mask in the assignment instruction. As part of this add ir_assignment::set_lhs. Ideally we'd make ir_assignment::lhs private to prevent erroneous writes, but that would require a lot of code butchery at this point. Add ir_assignment constructor that takes an explicit write mask. This is required for ir_assignment::clone, but it can also be used in other places. Without this, ir_assignment clones lose their write masks, and incorrect IR is generated in optimization passes. Add ir_assignment::whole_variable_written method. This method gets the variable on the LHS if the whole variable is written or NULL otherwise. This is different from ir->lhs->whole_variable_referenced() because the latter has no knowledge of the write mask stored in the ir_assignment. Gut all code from ir_to_mesa that handled swizzles on the LHS of assignments. There is probably some other refactoring that could be done here, but that can be left for another day.
* glsl2: Make the clone() method take a talloc context.Eric Anholt2010-08-041-83/+67
| | | | | | | In most cases, we needed to be reparenting the cloned IR to a different context (for example, to the linked shader instead of the unlinked shader), or optimization before the reparent would cause memory usage of the original object to grow and grow.
* glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius2010-08-021-1/+1
|
* glsl2: Fix spelling of "sentinel."Eric Anholt2010-07-291-1/+1
|
* glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.Eric Anholt2010-07-281-0/+2
| | | | | Fixes: glsl-arb-fragment-coord-conventions
* glsl2: Set the type on cloned tex instructions.Eric Anholt2010-07-221-0/+1
|
* glsl2: Extend ir_constant to store constant arrays, and generate them.Kenneth Graunke2010-07-211-0/+11
| | | | | | | | | Since GLSL permits arrays of structures, we need to store each element as an ir_constant*, not just ir_constant_data. Fixes parser tests const-array-01.frag, const-array-03.frag, const-array-04.frag, const-array-05.frag, though 03 and 04 generate the wrong code.
* glsl2: Add and use new variable mode ir_var_temporaryIan Romanick2010-07-201-2/+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
|
* glsl2: Remove unnecessary casts of clone return valuesIan Romanick2010-07-131-25/+22
|
* 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.
* glsl2: Add utility function clone_ir_listIan Romanick2010-07-121-0/+60
|
* glsl2: Implement ir_function::clone and ir_function_signature::cloneIan Romanick2010-07-121-6/+43
|
* glsl2: Add missing fields in ir_variable::cloneIan Romanick2010-07-121-0/+8
|
* glsl2: Clone methods return the type of the thing being clonedIan Romanick2010-07-061-17/+17
| | | | This is as opposed to returning the type of the base class of the hierarchy.
* glsl2: Define new ir_discard instruction.Kenneth Graunke2010-06-301-0/+12
|
* glsl2: Wrap includes of C interfaces with extern "C".Eric Anholt2010-06-241-0/+2
|
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+287