From c63a6f21494685d41d51887901298639c4d32c22 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 18 Jan 2016 11:23:49 +0100 Subject: i965/fs: implement d2i and d2u These need the same treatment as d2f, so generalize our d2f lowering to cover these too. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp | 4 +++- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp b/src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp index 60bd943bfdb..ed6df4a8103 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp @@ -36,7 +36,9 @@ fs_visitor::lower_d2f() if (inst->opcode != BRW_OPCODE_MOV) continue; - if (inst->dst.type != BRW_REGISTER_TYPE_F) + if (inst->dst.type != BRW_REGISTER_TYPE_F && + inst->dst.type != BRW_REGISTER_TYPE_D && + inst->dst.type != BRW_REGISTER_TYPE_UD) continue; if (inst->src[0].type != BRW_REGISTER_TYPE_DF) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index c456339f44e..1d5909afce1 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -725,6 +725,8 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr) case nir_op_f2d: case nir_op_d2f: + case nir_op_d2i: + case nir_op_d2u: inst = bld.MOV(result, op[0]); inst->saturate = instr->dest.saturate; break; -- cgit v1.2.3