diff options
author | Luca Barbieri <[email protected]> | 2010-09-08 01:35:44 +0200 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-17 10:58:58 +0200 |
commit | a47539c7a155475de00fa812842721d239abb3f4 (patch) | |
tree | ef930357c3500f4bb490d0ae46d565d9985e87c7 /src/glsl/ir_optimization.h | |
parent | dab2a7660a407364a33337327743b56ea9701d9b (diff) |
glsl: add pass to lower variable array indexing to conditional assignments
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]>
Diffstat (limited to 'src/glsl/ir_optimization.h')
-rw-r--r-- | src/glsl/ir_optimization.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h index b365ed2b235..5c8dc17d337 100644 --- a/src/glsl/ir_optimization.h +++ b/src/glsl/ir_optimization.h @@ -56,4 +56,5 @@ bool do_tree_grafting(exec_list *instructions); bool do_vec_index_to_cond_assign(exec_list *instructions); bool do_vec_index_to_swizzle(exec_list *instructions); bool lower_noise(exec_list *instructions); +bool lower_variable_index_to_cond_assign(exec_list *instructions); bool optimize_redundant_jumps(exec_list *instructions); |