glsl: fix assertion which fails for unsigned array indices.
authortiffany <tiffany@stormbit.net>
Sat, 30 Aug 2014 18:30:00 +0000 (12:30 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 3 Sep 2014 19:52:39 +0000 (13:52 -0600)
According to the GLSL 1.40 spec, section 5.7 Structure and Array Operations:

"Array elements are accessed using an expression whose type is int or uint."

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/glsl/lower_variable_index_to_cond_assign.cpp

index 7c5d80f432bcdd42063446611c40993e5989cce2..d878cb078115cbdb7b232f42c8f29810c059fd5c 100644 (file)
@@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index,
    ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index);
 
    assert(index->type->is_scalar());
-   assert(index->type->base_type == GLSL_TYPE_INT);
+   assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT);
    assert(components >= 1 && components <= 4);
 
    if (components > 1) {