diff options
author | Niklas Haas <git@haasn.xyz> | 2018-11-10 12:53:33 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-04-21 23:55:22 +0300 |
commit | 7006d6752d7da21870dfdb2b0d7640a3734f748c (patch) | |
tree | 035ca58d22de438e834d212e97b73d03a4248d98 /video/out/opengl | |
parent | 9f7dcc0726ab635fb34fb7310e54b1aec9467f14 (diff) | |
download | mpv-7006d6752d7da21870dfdb2b0d7640a3734f748c.tar.bz2 mpv-7006d6752d7da21870dfdb2b0d7640a3734f748c.tar.xz |
vo_gpu: vulkan: use libplacebo instead
This commit rips out the entire mpv vulkan implementation in favor of
exposing lightweight wrappers on top of libplacebo instead, which
provides much of the same except in a more up-to-date and polished form.
This (finally) unifies the code base between mpv and libplacebo, which
is something I've been hoping to do for a long time.
Note: The ra_pl wrappers are abstract enough from the actual libplacebo
device type that we can in theory re-use them for other devices like
d3d11 or even opengl in the future, so I moved them to a separate
directory for the time being. However, the rest of the code is still
vulkan-specific, so I've kept the "vulkan" naming and file paths, rather
than introducing a new `--gpu-api` type. (Which would have been ended up
with significantly more code duplicaiton)
Plus, the code and functionality is similar enough that for most users
this should just be a straight-up drop-in replacement.
Note: This commit excludes some changes; specifically, the updates to
context_win and hwdec_cuda are deferred to separate commits for
authorship reasons.
Diffstat (limited to 'video/out/opengl')
-rw-r--r-- | video/out/opengl/hwdec_cuda.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/video/out/opengl/hwdec_cuda.c b/video/out/opengl/hwdec_cuda.c index fee1f83f98..2e87593c78 100644 --- a/video/out/opengl/hwdec_cuda.c +++ b/video/out/opengl/hwdec_cuda.c @@ -39,9 +39,11 @@ #include "ra_gl.h" #endif #if HAVE_VULKAN +/* #include "video/out/vulkan/formats.h" #include "video/out/vulkan/ra_vk.h" #include "video/out/vulkan/utils.h" +*/ #endif #if HAVE_WIN32_DESKTOP @@ -125,6 +127,8 @@ static int cuda_init(struct ra_hwdec *hw) #endif #if HAVE_VULKAN + return -1; // TODO: reimplement + /* p->is_vk = ra_vk_get(hw->ra) != NULL; if (p->is_vk) { if (!ra_vk_get(hw->ra)->has_ext_external_memory_export) { @@ -133,6 +137,7 @@ static int cuda_init(struct ra_hwdec *hw) return -1; } } + */ #endif if (!p->is_gl && !p->is_vk) { @@ -197,6 +202,7 @@ static int cuda_init(struct ra_hwdec *hw) } } else if (p->is_vk) { #if HAVE_VULKAN + /* uint8_t vk_uuid[VK_UUID_SIZE]; struct mpvk_ctx *vk = ra_vk_get(hw->ra); @@ -236,6 +242,7 @@ static int cuda_init(struct ra_hwdec *hw) return -1; p->decode_ctx = p->display_ctx; + */ #endif } @@ -293,6 +300,7 @@ static void cuda_uninit(struct ra_hwdec *hw) #define CHECK_CU(x) check_cu((mapper)->owner, (x), #x) #if HAVE_VULKAN +/* static struct ra_buf *cuda_buf_pool_get(struct ra_hwdec_mapper *mapper, int n) { struct priv_owner *p_owner = mapper->owner->priv; @@ -390,6 +398,7 @@ static void cuda_buf_pool_uninit(struct ra_hwdec_mapper *mapper, int n) } ra_buf_pool_uninit(mapper->ra, pool); } +*/ #endif // HAVE_VULKAN static int mapper_init(struct ra_hwdec_mapper *mapper) @@ -497,7 +506,7 @@ static void mapper_uninit(struct ra_hwdec_mapper *mapper) ra_tex_free(mapper->ra, &mapper->tex[n]); #if HAVE_VULKAN - cuda_buf_pool_uninit(mapper, n); + //cuda_buf_pool_uninit(mapper, n); #endif } CHECK_CU(cu->cuCtxPopCurrent(&dummy)); |