#include "glsl/glsl_types.h"
void
-fs_inst::init()
+fs_inst::init(int sources)
{
memset(this, 0, sizeof(*this));
- this->src = ralloc_array(this, fs_reg, 3);
+ this->sources = sources;
+ this->src = ralloc_array(this, fs_reg, sources);
this->conditional_mod = BRW_CONDITIONAL_NONE;
fs_inst::fs_inst()
{
- init();
+ init(3);
this->opcode = BRW_OPCODE_NOP;
}
fs_inst::fs_inst(enum opcode opcode)
{
- init();
+ init(3);
this->opcode = opcode;
}
fs_inst::fs_inst(enum opcode opcode, fs_reg dst)
{
- init();
+ init(3);
this->opcode = opcode;
this->dst = dst;
fs_inst::fs_inst(enum opcode opcode, fs_reg dst, fs_reg src0)
{
- init();
+ init(3);
this->opcode = opcode;
this->dst = dst;
this->src[0] = src0;
fs_inst::fs_inst(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1)
{
- init();
+ init(3);
this->opcode = opcode;
this->dst = dst;
this->src[0] = src0;
fs_inst::fs_inst(enum opcode opcode, fs_reg dst,
fs_reg src0, fs_reg src1, fs_reg src2)
{
- init();
+ init(3);
this->opcode = opcode;
this->dst = dst;
this->src[0] = src0;
{
memcpy(this, &that, sizeof(that));
- this->src = ralloc_array(this, fs_reg, 3);
+ this->src = ralloc_array(this, fs_reg, that.sources);
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < that.sources; i++)
this->src[i] = that.src[i];
}
public:
DECLARE_RALLOC_CXX_OPERATORS(fs_inst)
- void init();
+ void init(int sources);
fs_inst();
fs_inst(enum opcode opcode);
uint32_t texture_offset; /**< Texture offset bitfield */
uint32_t offset; /* spill/unspill offset */
+ uint8_t sources; /**< Number of fs_reg sources. */
uint8_t conditional_mod; /**< BRW_CONDITIONAL_* */
/* Chooses which flag subregister (f0.0 or f0.1) is used for conditional