aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-09 16:34:28 +0100
committermarha <marha@users.sourceforge.net>2012-01-09 16:34:28 +0100
commita1e97828c89278770cb249039ec92d959440c640 (patch)
treef3d4ed7e3f3d589c606f01b3c9e6de03d638e2d3 /mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
parent7e9f4ea970e8f7008c212d7d3918a974eb0066da (diff)
downloadvcxsrv-a1e97828c89278770cb249039ec92d959440c640.tar.gz
vcxsrv-a1e97828c89278770cb249039ec92d959440c640.tar.bz2
vcxsrv-a1e97828c89278770cb249039ec92d959440c640.zip
xwininfo libX11 mesa mkfontscale xkeyboard-config git update 9 jan 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp')
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 73d956ea1..3b8e2fe37 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1402,8 +1402,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
}
break;
case ir_unop_neg:
- assert(result_dst.type == GLSL_TYPE_FLOAT || result_dst.type == GLSL_TYPE_INT);
- if (result_dst.type == GLSL_TYPE_INT)
+ if (result_dst.type == GLSL_TYPE_INT || result_dst.type == GLSL_TYPE_UINT)
emit(ir, TGSI_OPCODE_INEG, result_dst, op[0]);
else {
op[0].negate = ~op[0].negate;
@@ -1411,8 +1410,10 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
}
break;
case ir_unop_abs:
- assert(result_dst.type == GLSL_TYPE_FLOAT);
- emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
+ if (result_dst.type == GLSL_TYPE_INT || result_dst.type == GLSL_TYPE_UINT)
+ emit(ir, TGSI_OPCODE_IABS, result_dst, op[0]);
+ else
+ emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
break;
case ir_unop_sign:
emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
@@ -2375,7 +2376,7 @@ glsl_to_tgsi_visitor::visit(ir_constant *ir)
gl_type = native_integers ? GL_BOOL : GL_FLOAT;
for (i = 0; i < ir->type->vector_elements; i++) {
if (native_integers)
- values[i].b = ir->value.b[i];
+ values[i].u = ir->value.b[i] ? ~0 : 0;
else
values[i].f = ir->value.b[i];
}