summaryrefslogtreecommitdiffstats
path: root/video/out/vulkan/context.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-27 17:08:06 +0200
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-25 00:47:53 +0100
commit4e34615872011f906bf653f61e7ac75d2066a06b (patch)
tree25dc37e11f1f5cdb34619a22091dbf0dc9cf1116 /video/out/vulkan/context.c
parentad50e640dcf94da7f14c908a96c05b3de791d498 (diff)
downloadmpv-4e34615872011f906bf653f61e7ac75d2066a06b.tar.bz2
mpv-4e34615872011f906bf653f61e7ac75d2066a06b.tar.xz
vo_gpu: vulkan: refactor vk_cmdpool
1. No more static arrays (deps / callbacks / queues / cmds) 2. Allows safely recording multiple commands at the same time 3. Uses resources optimally by never over-allocating commands
Diffstat (limited to 'video/out/vulkan/context.c')
-rw-r--r--video/out/vulkan/context.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index 0bca198e50..5d9b40cbb5 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -102,8 +102,8 @@ const struct m_sub_options vulkan_conf = {
{"fifo-relaxed", SWAP_FIFO_RELAXED},
{"mailbox", SWAP_MAILBOX},
{"immediate", SWAP_IMMEDIATE})),
- OPT_INTRANGE("vulkan-queue-count", dev_opts.queue_count, 0, 1,
- MPVK_MAX_QUEUES, OPTDEF_INT(1)),
+ OPT_INTRANGE("vulkan-queue-count", dev_opts.queue_count, 0, 1, 8,
+ OPTDEF_INT(1)),
{0}
},
.size = sizeof(struct vulkan_opts)
@@ -244,7 +244,7 @@ void ra_vk_ctx_uninit(struct ra_ctx *ctx)
struct priv *p = ctx->swapchain->priv;
struct mpvk_ctx *vk = p->vk;
- mpvk_pool_wait_idle(vk, vk->pool);
+ mpvk_dev_wait_cmds(vk, UINT64_MAX);
for (int i = 0; i < p->num_images; i++)
ra_tex_free(ctx->ra, &p->images[i]);
@@ -355,7 +355,7 @@ bool ra_vk_ctx_resize(struct ra_swapchain *sw, int w, int h)
// more than one swapchain already active, so we need to flush any pending
// asynchronous swapchain release operations that may be ongoing.
while (p->old_swapchain)
- mpvk_dev_poll_cmds(vk, 100000); // 100μs
+ mpvk_dev_wait_cmds(vk, 100000); // 100μs
VkSwapchainCreateInfoKHR sinfo = p->protoInfo;
sinfo.imageExtent = (VkExtent2D){ w, h };
@@ -483,7 +483,7 @@ static bool submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame)
// We can drop this hack in the future, I suppose.
vk_cmd_cycle_queues(vk);
struct vk_cmdpool *pool = vk->pool;
- VkQueue queue = pool->queues[pool->qindex];
+ VkQueue queue = pool->queues[pool->idx_queues];
VkPresentInfoKHR pinfo = {
.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
@@ -506,7 +506,7 @@ static void swap_buffers(struct ra_swapchain *sw)
struct priv *p = sw->priv;
while (p->frames_in_flight >= sw->ctx->opts.swapchain_depth)
- mpvk_dev_poll_cmds(p->vk, 100000); // 100μs
+ mpvk_dev_wait_cmds(p->vk, 100000); // 100μs
}
static const struct ra_swapchain_fns vulkan_swapchain = {