summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Pohjolainen <topi.pohjolainen@intel.com>2014-09-03 12:24:07 +0300
committerTopi Pohjolainen <topi.pohjolainen@intel.com>2014-10-20 15:15:32 +0300
commit488c36aca69de755ecf96251c8e9c3186fce3f7d (patch)
treed03b31a73854f528cd59008b45a8a61f2c61772f
parent65284eb11e84a80411637f48a623e24f2a4a7c51 (diff)
i965/fs: Add support for ir_unop_pack_double_2x32
v2: Reverse the order of components - least significant 32-bits go to the first element. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp20
3 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 66173fe93c..f7b7b242d4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -547,6 +547,8 @@ public:
void emit_interpolate_expression(ir_expression *ir);
+ void emit_pack32(ir_expression *ir);
+
bool try_rewrite_rhs_to_dst(ir_assignment *ir,
fs_reg dst,
fs_reg src,
diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
index 6b0417299b..748870e71d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
@@ -82,6 +82,7 @@ channel_expressions_predicate(ir_instruction *ir)
case ir_unop_interpolate_at_centroid:
case ir_binop_interpolate_at_offset:
case ir_binop_interpolate_at_sample:
+ case ir_unop_pack_double_2x32:
return false;
default:
break;
@@ -169,6 +170,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
case ir_unop_interpolate_at_centroid:
case ir_binop_interpolate_at_offset:
case ir_binop_interpolate_at_sample:
+ case ir_unop_pack_double_2x32:
return visit_continue;
default:
@@ -448,6 +450,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
unreachable("not reached: expression operates on scalars only");
case ir_unop_pack_double_2x32:
+ unreachable("not reached: expression merges the input vector");
case ir_unop_unpack_double_2x32:
case ir_unop_frexp_sig:
case ir_unop_frexp_exp:
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 8c13803b37..3d755e8f6e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -473,6 +473,22 @@ fs_visitor::emit_interpolate_expression(ir_expression *ir)
}
void
+fs_visitor::emit_pack32(ir_expression *ir)
+{
+ assert(ir->operands[0]->type == glsl_type::uvec2_type);
+
+ ir_rvalue *rval = ir->operands[0];
+ rval->accept(this);
+
+ fs_reg src(this->result);
+ fs_reg tmp(this, glsl_type::double_type);
+
+ emit(FS_OPCODE_PACK_DOUBLE_2x32, tmp, offset(src, 1), src);
+
+ this->result = tmp;
+}
+
+void
fs_visitor::visit(ir_expression *ir)
{
unsigned int operand;
@@ -497,6 +513,10 @@ fs_visitor::visit(ir_expression *ir)
emit_interpolate_expression(ir);
return;
+ case ir_unop_pack_double_2x32:
+ emit_pack32(ir);
+ return;
+
default:
break;
}