Mesa (master): st/mesa: fix opcode translation for ARB_shader_bit_encoding functions
Marek Olšák
mareko at kemper.freedesktop.org
Tue Jul 30 21:44:38 UTC 2013
Module: Mesa
Branch: master
Commit: 369c8291523682dda5df5a64aded89ff696370f2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=369c8291523682dda5df5a64aded89ff696370f2
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Jul 30 22:29:25 2013 +0200
st/mesa: fix opcode translation for ARB_shader_bit_encoding functions
We treat the opcodes as MOVs, but we should at least change the type
of the expression, which later affects which TGSI opcode is chosen.
Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 69c1b41..3dfd5e5 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1832,10 +1832,17 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
emit(ir, TGSI_OPCODE_TRUNC, result_dst, op[0]);
break;
case ir_unop_bitcast_f2i:
+ result_src = op[0];
+ result_src.type = GLSL_TYPE_INT;
+ break;
case ir_unop_bitcast_f2u:
+ result_src = op[0];
+ result_src.type = GLSL_TYPE_UINT;
+ break;
case ir_unop_bitcast_i2f:
case ir_unop_bitcast_u2f:
result_src = op[0];
+ result_src.type = GLSL_TYPE_FLOAT;
break;
case ir_unop_f2b:
emit(ir, TGSI_OPCODE_SNE, result_dst, op[0], st_src_reg_for_float(0.0));
More information about the mesa-commit
mailing list