summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-08-10 12:47:06 +0200
committerLynne <dev@lynne.ee>2021-08-14 00:31:28 +0200
commit1c5610824a035604b32cb90d371f29e9d7e23607 (patch)
tree87a7be37b6d7287fa641a5b87e7ebc623fed0539 /libavutil
parentd5de9965ef680dad76ffca162afb20ddd9fd35d3 (diff)
hwcontext_vulkan: use GPU memcpy when copying to system RAM
This should speed it up significantly on systems where it matters.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/hwcontext_vulkan.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index b7da6a7e32..94fdad7f06 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3424,7 +3424,7 @@ static int vulkan_transfer_data(AVHWFramesContext *hwfc, const AVFrame *vkf,
}
if (!from) {
- /* Map, copy image to buffer, unmap */
+ /* Map, copy image TO buffer (which then goes to the VkImage), unmap */
if ((err = map_buffers(dev_ctx, bufs, tmp.data, planes, 0)))
goto end;
@@ -3449,7 +3449,7 @@ static int vulkan_transfer_data(AVHWFramesContext *hwfc, const AVFrame *vkf,
swf->width, swf->height, swf->format, from);
if (from) {
- /* Map, copy image to buffer, unmap */
+ /* Map, copy buffer (which came FROM the VkImage) to the frame, unmap */
if ((err = map_buffers(dev_ctx, bufs, tmp.data, planes, 0)))
goto end;
@@ -3459,10 +3459,10 @@ static int vulkan_transfer_data(AVHWFramesContext *hwfc, const AVFrame *vkf,
get_plane_wh(&p_w, &p_h, swf->format, swf->width, swf->height, i);
- av_image_copy_plane(swf->data[i], swf->linesize[i],
- (const uint8_t *)tmp.data[i], tmp.linesize[i],
- FFMIN(tmp.linesize[i], FFABS(swf->linesize[i])),
- p_h);
+ av_image_copy_plane_uc_from(swf->data[i], swf->linesize[i],
+ (const uint8_t *)tmp.data[i], tmp.linesize[i],
+ FFMIN(tmp.linesize[i], FFABS(swf->linesize[i])),
+ p_h);
}
if ((err = unmap_buffers(dev_ctx, bufs, planes, 1)))