OSDN Git Service

i965/fs: Add and use an fs_inst copy constructor.
authorMatt Turner <mattst88@gmail.com>
Thu, 20 Feb 2014 17:40:02 +0000 (09:40 -0800)
committerMatt Turner <mattst88@gmail.com>
Sun, 1 Jun 2014 20:29:23 +0000 (13:29 -0700)
Will get more complicated when fs_reg src becomes a pointer.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index 1a83c8c..af458ba 100644 (file)
@@ -139,6 +139,11 @@ fs_inst::fs_inst(enum opcode opcode, fs_reg dst,
       assert(src[2].reg_offset >= 0);
 }
 
+fs_inst::fs_inst(const fs_inst &that)
+{
+   memcpy(this, &that, sizeof(that));
+}
+
 #define ALU1(op)                                                        \
    fs_inst *                                                            \
    fs_visitor::op(fs_reg dst, fs_reg src0)                              \
index 789f0b3..bda233c 100644 (file)
@@ -197,6 +197,7 @@ public:
    fs_inst(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1);
    fs_inst(enum opcode opcode, fs_reg dst,
            fs_reg src0, fs_reg src1,fs_reg src2);
+   fs_inst(const fs_inst &that);
 
    bool equals(fs_inst *inst) const;
    bool overwrites_reg(const fs_reg &reg) const;