summaryrefslogtreecommitdiffstats
path: root/video/out/vulkan/malloc.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-11-10 12:53:33 +0100
committerJan Ekström <jeebjp@gmail.com>2019-04-21 23:55:22 +0300
commit7006d6752d7da21870dfdb2b0d7640a3734f748c (patch)
tree035ca58d22de438e834d212e97b73d03a4248d98 /video/out/vulkan/malloc.h
parent9f7dcc0726ab635fb34fb7310e54b1aec9467f14 (diff)
downloadmpv-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/vulkan/malloc.h')
-rw-r--r--video/out/vulkan/malloc.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/video/out/vulkan/malloc.h b/video/out/vulkan/malloc.h
deleted file mode 100644
index 9b311ce311..0000000000
--- a/video/out/vulkan/malloc.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-
-#include "common.h"
-
-void vk_malloc_init(struct mpvk_ctx *vk);
-void vk_malloc_uninit(struct mpvk_ctx *vk);
-
-// Represents a single "slice" of generic (non-buffer) memory, plus some
-// metadata for accounting. This struct is essentially read-only.
-struct vk_memslice {
- VkDeviceMemory vkmem;
- size_t offset;
- size_t size;
- size_t slab_size;
- void *priv;
-};
-
-void vk_free_memslice(struct mpvk_ctx *vk, struct vk_memslice slice);
-bool vk_malloc_generic(struct mpvk_ctx *vk, VkMemoryRequirements reqs,
- VkMemoryPropertyFlags flags, struct vk_memslice *out);
-
-// Represents a single "slice" of a larger buffer
-struct vk_bufslice {
- struct vk_memslice mem; // must be freed by the user when done
- VkBuffer buf; // the buffer this memory was sliced from
- // For persistently mapped buffers, this points to the first usable byte of
- // this slice.
- void *data;
-};
-
-// Allocate a buffer slice. This is more efficient than vk_malloc_generic for
-// when the user needs lots of buffers, since it doesn't require
-// creating/destroying lots of (little) VkBuffers.
-bool vk_malloc_buffer(struct mpvk_ctx *vk, VkBufferUsageFlags bufFlags,
- VkMemoryPropertyFlags memFlags, VkDeviceSize size,
- VkDeviceSize alignment, bool exportable,
- struct vk_bufslice *out);