diff options
author | Marek Olšák <[email protected]> | 2013-09-23 22:43:23 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-09-29 14:42:42 +0200 |
commit | 2bda5f3298154bab027aab6d4162b687ccdb36bd (patch) | |
tree | 056f89434b66d456a0daf4ab3623618cf62a453e /src | |
parent | a64d3dd1358fe0f69ebbf10da35c9ebd672e6f9d (diff) |
st/mesa: fix GLSL mix(.., .., bvecN)
v2: use CMP on drivers without native integer support
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 271cf052391..53838b391d2 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1944,6 +1944,14 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir) /* note: we have to reorder the three args here */ emit(ir, TGSI_OPCODE_LRP, result_dst, op[2], op[1], op[0]); break; + case ir_triop_csel: + if (this->ctx->Const.NativeIntegers) + emit(ir, TGSI_OPCODE_UCMP, result_dst, op[0], op[1], op[2]); + else { + op[0].negate = ~op[0].negate; + emit(ir, TGSI_OPCODE_CMP, result_dst, op[0], op[1], op[2]); + } + break; case ir_unop_pack_snorm_2x16: case ir_unop_pack_unorm_2x16: case ir_unop_pack_half_2x16: @@ -1970,7 +1978,6 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir) case ir_binop_vector_extract: case ir_triop_vector_insert: case ir_binop_ldexp: - case ir_triop_csel: /* This operation is not supported, or should have already been handled. */ assert(!"Invalid ir opcode in glsl_to_tgsi_visitor::visit()"); |