From c3cf7f3e35c0a2cf5124cf8f6084de84fe3e89ad Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Fri, 25 Aug 2023 17:02:00 -0400 Subject: [PATCH] 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: 12a4f2c1328 ("frontends/va: Also map VAImageBufferType for reading") Part-of: --- src/gallium/drivers/d3d12/d3d12_resource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp index a625347..05d0359 100644 --- a/src/gallium/drivers/d3d12/d3d12_resource.cpp +++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp @@ -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); -- 2.7.4