Mesa (master): glsl: Don' t use random pointers as an array of glsl_type objects.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Jun 26 18:40:21 UTC 2013


Module: Mesa
Branch: master
Commit: 818da74af542f50aa9c32c7471de58185c7de541
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=818da74af542f50aa9c32c7471de58185c7de541

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Jun 18 04:22:32 2013 -0700

glsl: Don't use random pointers as an array of glsl_type objects.

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 at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/glsl/lower_variable_index_to_cond_assign.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/lower_variable_index_to_cond_assign.cpp b/src/glsl/lower_variable_index_to_cond_assign.cpp
index 040b0bf..0f50727 100644
--- a/src/glsl/lower_variable_index_to_cond_assign.cpp
+++ b/src/glsl/lower_variable_index_to_cond_assign.cpp
@@ -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);
 




More information about the mesa-commit mailing list