mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
glsl: Use constant_expression_value instead of as_constant
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. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
b249712643
commit
146be3ddbe
1 changed files with 2 additions and 1 deletions
|
|
@ -219,7 +219,8 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
|
|||
if (array_index->type->base_type == GLSL_TYPE_INT)
|
||||
array_index = i2u(array_index);
|
||||
|
||||
ir_constant *const_index = array_index->as_constant();
|
||||
ir_constant *const_index =
|
||||
array_index->constant_expression_value(NULL);
|
||||
if (const_index) {
|
||||
const_offset += array_stride * const_index->value.u[0];
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue