History log of /external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f75c2d53146ea14f8dfedcc5b7a4704278ba0792 21-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.

Variables have types, expression trees have types, but statements don't.
Rather than have a nonsensical field that stays NULL in the base class,
just move it to where it makes sense.

Fix up a few places that lazily used ir_instruction even though they
actually knew the particular subclass.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
c1e591eed41b45c0fcf1dcac8b1b8aaeb6237a38 26-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Correctly return progress from lower_variable_index_to_cond_assign

lower_variable_index_to_cond_assign runs until it can't make any more
progress. It then returns the result of the last pass which will
always be false. This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign. This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements. This is easily controlled by
switch_generator::linear_sequence_max_length. This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
90cc372400e1f5869baabd841823bbf9296d7b01 19-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Factor out code that generates block of index comparisons

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
156f85336f80d542569f0b0182bd27c7f3218e70 19-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Treat ir_dereference_array of non-var as a constant for lowering

Previously the code would just look at deref->array->type to see if it
was a constant. This isn't good enough because deref->array might be
another ir_dereference_array... of a constant. As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL. The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced(). If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries. This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

vs-temp-array-mat[234]-index-col-rd
vs-temp-array-mat[234]-index-col-row-rd
vs-uniform-array-mat[234]-index-col-rd
vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
5f83dfe5b70337bcffe215f7c32d0b862b5e7a3b 18-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: When lowering non-constant array indexing, respect existing conditions

If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

fs-temp-array-mat[234]-col-row-wr
fs-temp-array-mat[234]-index-col-row-wr
fs-temp-array-mat[234]-index-col-wr
fs-temp-array-mat[234]-index-row-wr
vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
1731ac308631138ca98d34e8b7070c6e3f981939 18-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Rework lowering of non-constant array indexing

The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference. For example:

mat4 m[2];
m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value. The new
code fixes that by tracking l-values and r-values differently. The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt. Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
d2296e784aa8fad81c4910dcbbf61e826ce9a06a 18-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering

Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
8d5f3cef795428d7a95120416122a39c10cff11c 18-Jul-2011 Ian Romanick <ian.d.romanick@intel.com> glsl: Move is_array_or_matrix outside visitor class

There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
819d57fce94b20fa0d34da6f037f0a53c4a5bdc2 13-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Introduce a new "const_in" variable mode.

This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions. The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
d3073f58c17d8675a2ecdd5dfa83e5520c78e1a8 21-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> Convert everything from the talloc API to the ralloc API.
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
c00bc13564e432c496aa685d7b3ca7c60165be02 11-Jan-2011 Eric Anholt <eric@anholt.net> glsl: Fix the lowering of variable array indexing to not lose write_masks.

Fixes glsl-complex-subscript on 965.
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
668cdbe12958247f4a563c362dbf3247de7ccc3f 28-Sep-2010 Eric Anholt <eric@anholt.net> glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.

It's trying to get an int smeared across all channels, not trying to
get a 1:1 mapping of a subset of a vector's channels. This usually
ended up not mattering with ir_to_mesa, since it just smears floats
into every chan of a vec4.

Fixes:
glsl1-temp array with swizzled variable indexing
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
a822ae3f1a14ddd00a6368d767213ea42d00e7fb 18-Sep-2010 Vinson Lee <vlee@vmware.com> glsl: Fix 'control reaches end of non-void function' warning.

Fixes this GCC warning.

lower_variable_index_to_cond_assign.cpp:
In member function
'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const':

lower_variable_index_to_cond_assign.cpp:261:
warning: control reaches end of non-void function
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
a6ecd1c3724a78b76ab9e81ea39632f1279021f8 16-Sep-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Add flags to enable variable index lowering
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
6e4fe39da26bf101f5fe1103ba426c0903445352 16-Sep-2010 Ian Romanick <ian.d.romanick@intel.com> glsl2: Refactor testing for whether a deref is of a matrix or array
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp
a47539c7a155475de00fa812842721d239abb3f4 08-Sep-2010 Luca Barbieri <luca@luca-barbieri.com> 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>
/external/mesa3d/src/glsl/lower_variable_index_to_cond_assign.cpp