v3dv: fix copy image to buffer

If either of bufferRowLength or bufferImageHeight are zero, then that
aspect alone of the image is tighly packed. We were assuming that if
either was zero both aspects were tightly packed, which is wrong.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga 2020-01-16 17:09:36 +01:00 committed by Marge Bot
parent beee18103e
commit 54374f36df

View file

@ -116,13 +116,15 @@ emit_copy_layer_to_buffer_per_tile_list(struct v3dv_job *job,
/* Store TLB to buffer */
uint32_t width, height;
if (region->bufferRowLength == 0 || region->bufferImageHeight == 0) {
if (region->bufferRowLength == 0)
width = image->extent.width;
height = image->extent.height;
} else {
else
width = region->bufferRowLength;
if (region->bufferImageHeight == 0)
height = image->extent.height;
else
height = region->bufferImageHeight;
}
uint32_t buffer_stride = width * image->cpp;
uint32_t buffer_offset =