[Mesa-dev] [PATCH] Fix assertion which fails for unsigned array indices.

Brian Paul brianp at vmware.com
Wed Sep 3 08:57:20 PDT 2014


On 08/30/2014 12:30 PM, tiffany wrote:
> 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."
> ---
>   src/glsl/lower_variable_index_to_cond_assign.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/glsl/lower_variable_index_to_cond_assign.cpp b/src/glsl/lower_variable_index_to_cond_assign.cpp
> index 7c5d80f..d878cb0 100644
> --- a/src/glsl/lower_variable_index_to_cond_assign.cpp
> +++ b/src/glsl/lower_variable_index_to_cond_assign.cpp
> @@ -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) {
>

Looks OK to me.  Is there a (piglit) test which hits this?

Reviewed-by: Brian Paul <brianp at vmware.com>

Do you need someone to commit this for you?

-Brian



More information about the mesa-dev mailing list