[FFmpeg-cvslog] vulkan: keep track of mapped memory in the buffer structure
Lynne
git at videolan.org
Tue Oct 15 18:48:08 EEST 2024
ffmpeg | branch: master | Lynne <dev at lynne.ee> | Tue Oct 15 07:43:04 2024 +0200| [98f6d43146a0a7c7c42d33ed9deb54987508025c] | committer: Lynne
vulkan: keep track of mapped memory in the buffer structure
Can/could be useful to know which buffers are mapped.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98f6d43146a0a7c7c42d33ed9deb54987508025c
---
libavutil/vulkan.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 0c0c3b5fbc..346ed97953 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -1064,7 +1064,7 @@ int ff_vk_map_buffers(FFVulkanContext *s, FFVkBuffer **buf, uint8_t *mem[],
ff_vk_ret2str(ret));
return AVERROR_EXTERNAL;
}
- mem[i] = dst;
+ mem[i] = buf[i]->mapped_mem = dst;
}
if (!invalidate)
@@ -1126,8 +1126,10 @@ int ff_vk_unmap_buffers(FFVulkanContext *s, FFVkBuffer **buf, int nb_buffers,
}
}
- for (int i = 0; i < nb_buffers; i++)
+ for (int i = 0; i < nb_buffers; i++) {
vk->UnmapMemory(s->hwctx->act_dev, buf[i]->mem);
+ buf[i]->mapped_mem = NULL;
+ }
return err;
}
More information about the ffmpeg-cvslog
mailing list