summaryrefslogtreecommitdiffstats
path: root/video/out/gpu
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2018-09-29 17:56:07 -0700
committersfan5 <sfan5@live.de>2018-10-22 21:35:48 +0200
commit93f800a00f3f8ef416082e0a3f9d34d979a1e9a6 (patch)
treeb5108b3c2f4f4357adf0f9921c6b59a6c8e162e6 /video/out/gpu
parent6fbd933108a74bbd3a375be1456692320a97380e (diff)
downloadmpv-93f800a00f3f8ef416082e0a3f9d34d979a1e9a6.tar.bz2
mpv-93f800a00f3f8ef416082e0a3f9d34d979a1e9a6.tar.xz
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.
Diffstat (limited to 'video/out/gpu')
-rw-r--r--video/out/gpu/ra.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/gpu/ra.h b/video/out/gpu/ra.h
index 79caacc919..748b485c95 100644
--- a/video/out/gpu/ra.h
+++ b/video/out/gpu/ra.h
@@ -188,6 +188,7 @@ enum ra_buf_type {
RA_BUF_TYPE_SHADER_STORAGE, // shader buffer (SSBO), for RA_VARTYPE_BUF_RW
RA_BUF_TYPE_UNIFORM, // uniform buffer (UBO), for RA_VARTYPE_BUF_RO
RA_BUF_TYPE_VERTEX, // not publicly usable (RA-internal usage)
+ RA_BUF_TYPE_SHARED_MEMORY, // device memory for sharing with external API
};
struct ra_buf_params {