if (buffer_image_height == 0)
buffer_image_height = copycmd->regions[i].imageExtent.height;
+ unsigned img_stride = util_format_get_2d_size(dst_format, buffer_row_len, buffer_image_height);
if (src_format != dst_format) {
copy_depth_box(dst_data, dst_format,
- buffer_row_len, buffer_row_len * buffer_image_height,
+ buffer_row_len, img_stride,
0, 0, 0,
copycmd->regions[i].imageExtent.width,
copycmd->regions[i].imageExtent.height,
src_data, src_format, src_t->stride, src_t->layer_stride, 0, 0, 0);
} else {
util_copy_box((ubyte *)dst_data, src_format,
- buffer_row_len, buffer_row_len * buffer_image_height,
+ buffer_row_len, img_stride,
0, 0, 0,
copycmd->regions[i].imageExtent.width,
copycmd->regions[i].imageExtent.height,
if (buffer_image_height == 0)
buffer_image_height = copycmd->regions[i].imageExtent.height;
+ unsigned img_stride = util_format_get_2d_size(src_format, buffer_row_len, buffer_image_height);
if (src_format != dst_format) {
copy_depth_box(dst_data, dst_format,
dst_t->stride, dst_t->layer_stride,
copycmd->regions[i].imageExtent.height,
box.depth,
src_data, src_format,
- buffer_row_len, buffer_row_len * buffer_image_height, 0, 0, 0);
+ buffer_row_len, img_stride, 0, 0, 0);
} else {
util_copy_box(dst_data, dst_format,
dst_t->stride, dst_t->layer_stride,
copycmd->regions[i].imageExtent.height,
box.depth,
src_data,
- buffer_row_len, buffer_row_len * buffer_image_height, 0, 0, 0);
+ buffer_row_len, img_stride, 0, 0, 0);
}
state->pctx->transfer_unmap(state->pctx, src_t);
state->pctx->transfer_unmap(state->pctx, dst_t);