From 93f800a00f3f8ef416082e0a3f9d34d979a1e9a6 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sat, 29 Sep 2018 17:56:07 -0700 Subject: vo_gpu: vulkan: Add support for exporting buffer memory The CUDA/Vulkan interop works on the basis of memory being exported from Vulkan and then imported by CUDA. To enable this, we add a way to declare a buffer as being intended for export, and then add a function to do the export. For now, we support the fd and Handle based exports on Linux and Windows respectively. There are others, which we can support when a need arises. Also note that this is just for exporting buffers, rather than textures (VkImages). Image import on the CUDA side is supposed to work, but it is currently buggy and waiting for a new driver release. Finally, at least with my nvidia hardware and drivers, everything seems to work even if we don't initialise the buffer with the right exportability options. Nevertheless I'm enforcing it so that we're following the spec. --- video/out/vulkan/common.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'video/out/vulkan/common.h') diff --git a/video/out/vulkan/common.h b/video/out/vulkan/common.h index 1a4c3b842f..a4284f9055 100644 --- a/video/out/vulkan/common.h +++ b/video/out/vulkan/common.h @@ -73,4 +73,8 @@ struct mpvk_ctx { // Cached capabilities VkPhysicalDeviceLimits limits; VkPhysicalDeviceFeatures features; + + // Extension availability + bool has_ext_external_memory; + bool has_ext_external_memory_export; }; -- cgit v1.2.3