It's more of a question of what the GLSL compiler did before the introduction of ir_triop_csel. I guess it used LRP.
Marek On Tue, Sep 24, 2013 at 8:12 PM, Ian Romanick <i...@freedesktop.org> wrote: > On 09/23/2013 05:37 PM, mar...@gmail.com wrote: >> From: Marek Olšák <marek.ol...@amd.com> >> >> --- >> src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp >> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp >> index 271cf05..0d1506d 100644 >> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp >> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp >> @@ -1944,6 +1944,13 @@ 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 >> + /* CMP doesn't work here */ >> + emit(ir, TGSI_OPCODE_LRP, result_dst, op[0], op[1], op[2]); >> + break; > > That won't do the right thing if one of the sources is NaN. What did > TGSI do before Matt's changes? For conditional assignments? > >> case ir_unop_pack_snorm_2x16: >> case ir_unop_pack_unorm_2x16: >> case ir_unop_pack_half_2x16: >> @@ -1970,7 +1977,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()"); >> > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev