aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2016-01-18 11:23:49 +0100
committerSamuel Iglesias Gonsálvez <[email protected]>2016-05-10 11:25:08 +0200
commitc63a6f21494685d41d51887901298639c4d32c22 (patch)
tree54b1d5e8ed444be43ca7eb9ef0c3aff1b129353c /src
parente0c45182e3d865d7f187dc35e70832f1fa7c9fad (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_lower_d2f.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp2
2 files changed, 5 insertions, 1 deletions
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;