From: Matt Turner Date: Thu, 20 Feb 2014 21:14:05 +0000 (-0800) Subject: i965/fs: Add a function to resize fs_inst's sources array. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=521f9b9a48da586ca3352cea7f8bf7c49741cf0d;p=mesa.git i965/fs: Add a function to resize fs_inst's sources array. Reviewed-by: Chris Forbes Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 9ebb86915c4..f23a946e7ae 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -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) \ diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index fb68923009c..b7cfb3c96e9 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -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 ®) const; bool is_send_from_grf() const;