summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_algebraic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: When doing algebraic simplification, make sure the type still matches.Eric Anholt2010-08-171-12/+34
| | | | | | | | | | | | When simplifying (vec4(1.0) / (float(x))) to rcp(float(x)), we forgot to produce a vec4, angering ir_validate when starting alien-arena. Fixes: glsl-algebraic-add-zero-2 glsl-algebraic-div-one-2 glsl-algebraic-mul-one-2 glsl-algebraic-sub-zero-3 glsl-algebraic-rcp-sqrt-2
* glsl: Make ir_algebraic new expressions allocate out of the parent.Eric Anholt2010-08-171-16/+22
| | | | | This could reduce the amount of memory used by a shader tree after optimization, and increases consistency with other passes.
* glsl2: Add a generic visitor class to call back with pointers to each rvalue.Eric Anholt2010-08-131-105/+15
| | | | | I keep copy and pasting this code all over, so consolidate it in one place.
* glsl2: Make ir_algebraic reassociate add/mul operands for constant folding.Eric Anholt2010-08-091-1/+107
| | | | | | | | It's rather easy to produce two constant multiplies separated by other multiplies while writing a BRDF shader, and non-obvious enough in the resulting codegen that I didn't catch it in my demo code until just recently. Cuts 3 965 instructions from my demo (<1%), and 20 from glsl-fs-raytrace (1.3%).
* ir_algebraic: Support other comparisons in ir_unop_logic_notIan Romanick2010-08-091-0/+4
|
* ir_algebraic: Convert ir_unop_logic_not handler to use a switch statementIan Romanick2010-08-091-9/+19
| | | | | | Currently only ir_binop_equal and ir_binop_nequal are supported, but soon all of the relational operators will be added. Making this change now will simplify those commits.
* ir_algebraic: Use ir_constant::zero.Kenneth Graunke2010-07-281-6/+2
|
* glsl2: Add optimization pass for algebraic simplifications.Eric Anholt2010-07-271-0/+366
This cleans up the assembly output of almost all the non-logic tests glsl-algebraic-*. glsl-algebraic-pow-two needs love (basically, flattening to a temporary and squaring it).