return swizzle;
}
+static st_src_reg *
+dup_reladdr(const st_src_reg *input)
+{
+ if (!input)
+ return NULL;
+
+ st_src_reg *reg = ralloc(input, st_src_reg);
+ if (!reg) {
+ assert(!"can't create reladdr, expect shader breakage");
+ return NULL;
+ }
+
+ *reg = *input;
+ return reg;
+}
+
st_src_reg::st_src_reg(gl_register_file file, int index, const glsl_type *type,
int component, unsigned array_id)
{
this->is_double_vertex_input = false;
}
+st_src_reg::st_src_reg(const st_src_reg ®)
+{
+ *this = reg;
+}
+
+void st_src_reg::operator=(const st_src_reg ®)
+{
+ this->type = reg.type;
+ this->file = reg.file;
+ this->index = reg.index;
+ this->index2D = reg.index2D;
+ this->swizzle = reg.swizzle;
+ this->negate = reg.negate;
+ this->abs = reg.abs;
+ this->reladdr = dup_reladdr(reg.reladdr);
+ this->reladdr2 = dup_reladdr(reg.reladdr2);
+ this->has_index2 = reg.has_index2;
+ this->double_reg2 = reg.double_reg2;
+ this->array_id = reg.array_id;
+ this->is_double_vertex_input = reg.is_double_vertex_input;
+}
+
st_src_reg::st_src_reg(st_dst_reg reg)
{
this->type = reg.type;
this->swizzle = SWIZZLE_XYZW;
this->negate = 0;
this->abs = 0;
- this->reladdr = reg.reladdr;
+ this->reladdr = dup_reladdr(reg.reladdr);
this->index2D = reg.index2D;
- this->reladdr2 = reg.reladdr2;
+ this->reladdr2 = dup_reladdr(reg.reladdr2);
this->has_index2 = reg.has_index2;
this->double_reg2 = false;
this->array_id = reg.array_id;
this->file = reg.file;
this->index = reg.index;
this->writemask = WRITEMASK_XYZW;
- this->reladdr = reg.reladdr;
+ this->reladdr = dup_reladdr(reg.reladdr);
this->index2D = reg.index2D;
- this->reladdr2 = reg.reladdr2;
+ this->reladdr2 = dup_reladdr(reg.reladdr2);
this->has_index2 = reg.has_index2;
this->array_id = reg.array_id;
}
this->reladdr2 = NULL;
this->has_index2 = false;
this->array_id = 0;
-}
\ No newline at end of file
+}
+
+st_dst_reg::st_dst_reg(const st_dst_reg ®)
+{
+ *this = reg;
+}
+
+void st_dst_reg::operator=(const st_dst_reg ®)
+{
+ this->type = reg.type;
+ this->file = reg.file;
+ this->index = reg.index;
+ this->writemask = reg.writemask;
+ this->reladdr = dup_reladdr(reg.reladdr);
+ this->index2D = reg.index2D;
+ this->reladdr2 = dup_reladdr(reg.reladdr2);
+ this->has_index2 = reg.has_index2;
+ this->array_id = reg.array_id;
+}
st_src_reg(gl_register_file file, int index, enum glsl_base_type type, int index2D);
st_src_reg();
+ st_src_reg(const st_src_reg ®);
+ void operator=(const st_src_reg ®);
explicit st_src_reg(st_dst_reg reg);
st_dst_reg(gl_register_file file, int writemask, enum glsl_base_type type);
st_dst_reg();
+ st_dst_reg(const st_dst_reg ®);
+ void operator=(const st_dst_reg ®);
explicit st_dst_reg(st_src_reg reg);