glsl: Support uint index in do_vec_index_to_cond_assign
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 13 Oct 2015 03:22:14 +0000 (20:22 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 14 Oct 2015 20:16:34 +0000 (13:16 -0700)
The ES31-CTS.compute_shader.pipeline-compute-chain test case generates
an unsigned index by using gl_LocalInvocationID.x and
gl_LocalInvocationID.y as array indices.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/lower_vec_index_to_cond_assign.cpp

index 0c3394a504bcf373601e7f460513d692d8debe34..b6238825f8a7e7524597b9d4e97bd8ac6f8c6c78 100644 (file)
@@ -88,7 +88,9 @@ ir_vec_index_to_cond_assign_visitor::convert_vec_index_to_cond_assign(void *mem_
    exec_list list;
 
    /* Store the index to a temporary to avoid reusing its tree. */
-   index = new(base_ir) ir_variable(glsl_type::int_type,
+   assert(orig_index->type == glsl_type::int_type ||
+          orig_index->type == glsl_type::uint_type);
+   index = new(base_ir) ir_variable(orig_index->type,
                                    "vec_index_tmp_i",
                                    ir_var_temporary);
    list.push_tail(index);