On 07/21/2014 03:39 PM, Matt Turner wrote: > On Mon, Jul 21, 2014 at 2:04 PM, Ian Romanick <i...@freedesktop.org> wrote: >> From: Ian Romanick <ian.d.roman...@intel.com> >> >> Just a few lines earlier we may have wrapped the index expression with >> ir_unop_i2u expression. Whenever that happens, as_constant will return >> NULL, and that almost always happens. > > Are you saying that since we just passed array_index to i2u we know it > must be a constant? I can follow that much, but I don't see anything > that really makes sure this is a constant.
The code tries really hard to just generate a constant offset for the UBO access. To implement this optimization, this code was assuming the array index would be an ir_constant if the value was constant... but it does this right after possibly wrapping the ir_constant with an ir_expression. This change just makes the optimization actually do what it's intending to do by use ::constant_expression_value instead of as_constant. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev