diff options
author | Bryan Cain <[email protected]> | 2012-01-07 16:19:39 -0600 |
---|---|---|
committer | Bryan Cain <[email protected]> | 2012-01-07 16:20:28 -0600 |
commit | 73b26e4d12e5fa07bb96b4a30f41bd3b583776aa (patch) | |
tree | b3a68a93380bf1005347662356217ff8a9ee05a9 /src/mesa | |
parent | 56b57aa360a8bad0c4b68fbdf7c64ac33f9e7661 (diff) |
glsl_to_tgsi: emit IABS for absolute value of integers
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 539701173f8..3b8e2fe3742 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1410,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]); |