i965/fs: Add a function to resize fs_inst's sources array.
authorMatt Turner <mattst88@gmail.com>
Thu, 20 Feb 2014 21:14:05 +0000 (13:14 -0800)
committerMatt Turner <mattst88@gmail.com>
Sun, 1 Jun 2014 20:29:24 +0000 (13:29 -0700)
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 9ebb86915c47b26ffe8a15d52eb3bfa5daa7bc84..f23a946e7aede6dc833d36f878b18818a85dc7ee 100644 (file)
@@ -111,6 +111,15 @@ fs_inst::fs_inst(const fs_inst &that)
       this->src[i] = that.src[i];
 }
 
+void
+fs_inst::resize_sources(uint8_t num_sources)
+{
+   if (this->sources != num_sources) {
+      this->src = reralloc(this, this->src, fs_reg, num_sources);
+      this->sources = num_sources;
+   }
+}
+
 #define ALU1(op)                                                        \
    fs_inst *                                                            \
    fs_visitor::op(fs_reg dst, fs_reg src0)                              \
index fb68923009c6230e41802fb1c767ae395ce6d0c7..b7cfb3c96e98b6252c5ab2acfda9891a90869035 100644 (file)
@@ -200,6 +200,8 @@ public:
            const fs_reg &src1, const fs_reg &src2);
    fs_inst(const fs_inst &that);
 
+   void resize_sources(uint8_t num_sources);
+
    bool equals(fs_inst *inst) const;
    bool overwrites_reg(const fs_reg &reg) const;
    bool is_send_from_grf() const;