Mesa (master): glsl: Fix assertion failure on handling switch on uint expressions.

Eric Anholt anholt at kemper.freedesktop.org
Thu May 17 17:20:32 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon May 14 08:51:03 2012 -0700

glsl: Fix assertion failure on handling switch on uint expressions.

Fixes piglit glsl-1.30/execution/switch/fs-uint.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

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

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index c59e5e6..998f8dd 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -3599,7 +3599,7 @@ ast_switch_statement::test_to_hir(exec_list *instructions,
       test_expression->hir(instructions,
 			   state);
 
-   state->switch_state.test_var = new(ctx) ir_variable(glsl_type::int_type,
+   state->switch_state.test_var = new(ctx) ir_variable(test_val->type,
 						       "switch_test_tmp",
 						       ir_var_temporary);
    ir_dereference_variable *deref_test_var =




More information about the mesa-commit mailing list