aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-05-26 18:44:17 -0700
committerMatt Turner <[email protected]>2014-06-01 13:29:24 -0700
commit84e0a5c406f2a8f060352eaa4b5c138e3f1a5a86 (patch)
tree393ce25187509103739984c8a8b25699901b71e5
parent521f9b9a48da586ca3352cea7f8bf7c49741cf0d (diff)
i965/fs: Add fs_inst constructor that takes a list of sources.
Also add an emit() function that calls it. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp12
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index f23a946e7ae..3fa83340b21 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -101,6 +101,11 @@ fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
init(opcode, dst, src, 3);
}
+fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, fs_reg src[], int sources)
+{
+ init(opcode, dst, src, sources);
+}
+
fs_inst::fs_inst(const fs_inst &that)
{
memcpy(this, &that, sizeof(that));
@@ -740,6 +745,13 @@ fs_visitor::emit(enum opcode opcode, fs_reg dst,
return emit(new(mem_ctx) fs_inst(opcode, dst, src0, src1, src2));
}
+fs_inst *
+fs_visitor::emit(enum opcode opcode, fs_reg dst,
+ fs_reg src[], int sources)
+{
+ return emit(new(mem_ctx) fs_inst(opcode, dst, src, sources));
+}
+
void
fs_visitor::push_force_uncompressed()
{
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index b7cfb3c96e9..527c3f3bf58 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -198,6 +198,7 @@ public:
const fs_reg &src1);
fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
const fs_reg &src1, const fs_reg &src2);
+ fs_inst(enum opcode opcode, const fs_reg &dst, fs_reg src[], int sources);
fs_inst(const fs_inst &that);
void resize_sources(uint8_t num_sources);
@@ -295,6 +296,8 @@ public:
fs_inst *emit(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1);
fs_inst *emit(enum opcode opcode, fs_reg dst,
fs_reg src0, fs_reg src1, fs_reg src2);
+ fs_inst *emit(enum opcode opcode, fs_reg dst,
+ fs_reg src[], int sources);
fs_inst *MOV(fs_reg dst, fs_reg src);
fs_inst *NOT(fs_reg dst, fs_reg src);