v2: Account for the stride of the dst (Iago)
Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
{
instruction *inst = emit(SHADER_OPCODE_LOAD_PAYLOAD, dst, src, sources);
inst->header_size = header_size;
- inst->regs_written = header_size +
- (sources - header_size) * (dispatch_width() / 8);
+ inst->regs_written = header_size;
+ for (unsigned i = header_size; i < sources; i++) {
+ inst->regs_written +=
+ DIV_ROUND_UP(dispatch_width() * type_sz(src[i].type) *
+ dst.stride, REG_SIZE);
+ }
return inst;
}