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 <ian.d.romanick@intel.com>
This commit is contained in:

committed by
Ian Romanick

parent
dab2a7660a
commit
a47539c7a1
@@ -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);
|
||||
|
Reference in New Issue
Block a user