emit_asm(ir, TGSI_OPCODE_USHR, st_dst_reg(index_reg), offset,
st_src_reg_for_int(4));
cbuf.reladdr = ralloc(mem_ctx, st_src_reg);
- memcpy(cbuf.reladdr, &index_reg, sizeof(index_reg));
+ *cbuf.reladdr = index_reg;
}
if (const_uniform_block) {
} else {
/* Relative/variable constant buffer */
cbuf.reladdr2 = ralloc(mem_ctx, st_src_reg);
- memcpy(cbuf.reladdr2, &op[0], sizeof(st_src_reg));
+ *cbuf.reladdr2 = op[0];
}
cbuf.has_index2 = true;
if (is_2D) {
src.reladdr2 = ralloc(mem_ctx, st_src_reg);
- memcpy(src.reladdr2, &index_reg, sizeof(index_reg));
+ *src.reladdr2 = index_reg;
src.index2D = 0;
src.has_index2 = true;
} else {
src.reladdr = ralloc(mem_ctx, st_src_reg);
- memcpy(src.reladdr, &index_reg, sizeof(index_reg));
+ *src.reladdr = index_reg;
}
}
unsigned location = 0;
ir_variable *var = ir->variable_referenced();
- memset(reladdr, 0, sizeof(*reladdr));
- reladdr->file = PROGRAM_UNDEFINED;
+ reladdr->reset();
*base = 0;
*array_size = 1;
this->is_double_vertex_input = false;
}
-st_src_reg::st_src_reg()
+void st_src_reg::reset()
{
this->type = GLSL_TYPE_ERROR;
this->file = PROGRAM_UNDEFINED;
this->is_double_vertex_input = false;
}
+st_src_reg::st_src_reg()
+{
+ reset();
+}
+
st_src_reg::st_src_reg(const st_src_reg ®)
{
*this = reg;