summaryrefslogtreecommitdiffstats
path: root/src/glsl/SConscript
Commit message (Collapse)AuthorAgeFilesLines
* glsl: add pass to lower variable array indexing to conditional assignmentsLuca Barbieri2010-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currenly GLSL happily generates indirect addressing of any kind of arrays. Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in general. This pass fixes that by lowering such constructs to a binary search on the values, followed at the end by vectorized generation of equality masks, and 4 conditional assignments for each mask generation. Note that this requires the ir_binop_equal change so that we can emit SEQ to generate the boolean masks. Unfortunately, ir_structure_splitting is too dumb to turn the resulting constant array references to individual variables, so this will need to be added too before this pass can actually be effective for temps. Several patches in the glsl2-lower-variable-indexing were squashed into this commit. These patches fix bugs in Luca's original implementation, and the individual patches can be seen in that branch. This was done to aid bisecting in the future. Signed-off-by: Ian Romanick <[email protected]>
* glsl2: Add pass to remove redundant jumpsIan Romanick2010-09-131-0/+1
|
* glsl: add continue/break/return unification/elimination pass (v2)Luca Barbieri2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in v2: - Base class renamed to ir_control_flow_visitor - Tried to comply with coding style This is a new pass that supersedes ir_if_return and "lowers" jumps to if/else structures. Currently it causes no regressions on softpipe and nv40, but I'm not sure whether the piglit glsl tests are thorough enough, so consider this experimental. It can be asked to: 1. Pull jumps out of ifs where possible 2. Remove all "continue"s, replacing them with an "execute flag" 3. Replace all "break" with a single conditional one at the end of the loop 4. Replace all "return"s with a single return at the end of the function, for the main function and/or other functions This gives several great benefits: 1. All functions can be inlined after this pass 2. nv40 and other pre-DX10 chips without "continue" can be supported 3. nv30 and other pre-DX10 chips with no control flow at all are better supported Note that for full effect we should also teach the unroller to unroll loops with a fixed maximum number of iterations but with the canonical conditional "break" that this pass will insert if asked to. Continues are lowered by adding a per-loop "execute flag", initialized to TRUE, that when cleared inhibits all execution until the end of the loop. Breaks are lowered to continues, plus setting a "break flag" that is checked at the end of the loop, and trigger the unique "break". Returns are lowered to breaks/continues, plus adding a "return flag" that causes loops to break again out of their enclosing loops until all the loops are exited: then the "execute flag" logic will ignore everything until the end of the function. Note that "continue" and "return" can also be implemented by adding a dummy loop and using break. However, this is bad for hardware with limited nesting depth, and prevents further optimization, and thus is not currently performed.
* glsl2: Fix scons build for all platformsJakob Bornecrantz2010-09-101-0/+1
|
* glsl: Add new files to sconscript.José Fonseca2010-09-051-0/+3
|
* scons: Add glsl_symbol_table.cppJosé Fonseca2010-08-261-0/+1
|
* scons: Add new source files.José Fonseca2010-08-141-0/+2
|
* scons: Build the new glsl2 code.José Fonseca2010-08-131-40/+72
|
* scons: Fix xlib build.José Fonseca2009-12-281-1/+1
| | | | After glsl rework merge.
* glsl/pp: move static functions out of header fileKeith Whitwell2009-12-231-0/+1
|
* scons: Get GLSL code building correctly when cross compiling.José Fonseca2009-12-101-0/+68
This is quite messy. GLSL code has to be built twice: one for the host OS, another for the target OS.