d3d12: Fix Map/Unmap of YUV resources

Restore transfer box original size after temporal per plane
dimension calculation.

Currently the returned transfer object on Map will have the
size (usually downsampled) of the latest plane instead of
the overall resource size. Then on unmap, when flushing the
changes the received transfer box has the wrong dimensions
and only partial data is flushed.

Fixes: 12a4f2c132 ("frontends/va: Also map VAImageBufferType for reading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24909>
This commit is contained in:
Sil Vilerino
2023-08-25 17:02:00 -04:00
parent 71466eb863
commit c3cf7f3e35

View File

@@ -1716,7 +1716,7 @@ d3d12_transfer_map(struct pipe_context *pctx,
return NULL;
}
}
ptrans->box = original_box;
d3d12_flush_cmdlist_and_wait(ctx);
}
@@ -1868,6 +1868,7 @@ d3d12_transfer_unmap(struct pipe_context *pctx,
transfer_buf_to_image(ctx, d3d12_resource(planes[plane_slice]), staging_res, trans, 0);
}
ptrans->box = original_box;
}
pipe_resource_reference(&trans->staging_res, NULL);