The displaytarget's resource stride is alignment is currently 64-bytes,
where the shared resource stride is unaligned.
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11714>
if (sub_box) {
box = *sub_box;
- offset = box.y / util_format_get_blockheight(res->format) * res->stride +
+ uint32_t shm_stride = util_format_get_stride(res->format, res->width);
+ offset = box.y / util_format_get_blockheight(res->format) * shm_stride +
box.x / util_format_get_blockwidth(res->format) * util_format_get_blocksize(res->format);
} else {
box.z = layer;