glsl: Don't use random pointers as an array of glsl_type objects.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Jun 2013 11:22:32 +0000 (04:22 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 26 Jun 2013 18:25:12 +0000 (11:25 -0700)
Using a random glsl_type convenience pointer as an array is a really bad
idea, for all the reasons mentioned in the previous commit.

The new glsl_type::bvec() function is simpler anyway.

Prevents breakage in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/lower_variable_index_to_cond_assign.cpp

index 040b0bf83576197bc65602655739672b96a2a6fa..0f507279382d583cbd442056025516f978f16c33 100644 (file)
@@ -99,7 +99,7 @@ compare_index_block(exec_list *instructions, ir_variable *index,
 
    ir_rvalue *const condition_val =
       new(mem_ctx) ir_expression(ir_binop_equal,
-                                &glsl_type::bool_type[components - 1],
+                                glsl_type::bvec(components),
                                 broadcast_index,
                                 test_indices);