summaryrefslogtreecommitdiff
path: root/src/glsl/ir_clone.cpp
AgeCommit message (Collapse)Author
2010-09-03glsl2: Add cmp field to ir_loopIan Romanick
This reprents the type of comparison between the loop induction variable and the loop termination value.
2010-08-26glsl: Move is_built_in flag from ir_function_signature to ir_function.Kenneth Graunke
Also rename it to "is_builtin" for consistency. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-08-14glsl: Silence gcc warning "control reaches end of non-void function".José Fonseca
2010-08-04glsl2: Remove the shader_in/shader_out tracking separate from var->mode.Eric Anholt
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.
2010-08-04glsl2: Add ir_assignment::write_mask and associated methodsIan Romanick
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.
2010-08-04glsl2: Make the clone() method take a talloc context.Eric Anholt
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.
2010-08-02glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius
2010-07-29glsl2: Fix spelling of "sentinel."Eric Anholt
2010-07-28glsl2: Add support for redeclaring layout of gl_FragCoord for ARB_fcc.Eric Anholt
Fixes: glsl-arb-fragment-coord-conventions
2010-07-22glsl2: Set the type on cloned tex instructions.Eric Anholt
2010-07-21glsl2: Extend ir_constant to store constant arrays, and generate them.Kenneth Graunke
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.
2010-07-20glsl2: Add and use new variable mode ir_var_temporaryIan Romanick
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'.
2010-07-18glsl2: Remove the const disease from function signature's callee.Eric Anholt
2010-07-13glsl2: Remove unnecessary casts of clone return valuesIan Romanick
2010-07-12linker: Implement first bits of intrastage linkingIan Romanick
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.
2010-07-12glsl2: Add utility function clone_ir_listIan Romanick
2010-07-12glsl2: Implement ir_function::clone and ir_function_signature::cloneIan Romanick
2010-07-12glsl2: Add missing fields in ir_variable::cloneIan Romanick
2010-07-06glsl2: Clone methods return the type of the thing being clonedIan Romanick
This is as opposed to returning the type of the base class of the hierarchy.
2010-06-30glsl2: Define new ir_discard instruction.Kenneth Graunke
2010-06-24glsl2: Wrap includes of C interfaces with extern "C".Eric Anholt
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt