summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-10-28 16:02:08 +0200
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-25 00:47:53 +0100
commitd588bdaaf7473685ce85438c0a7b80c77f719ece (patch)
treeabf4ee55b3ff1ab0157b6149cedf7512724c634f
parent12c6700a3c770d74237ded74c307e4fd952a1d31 (diff)
downloadmpv-d588bdaaf7473685ce85438c0a7b80c77f719ece.tar.bz2
mpv-d588bdaaf7473685ce85438c0a7b80c77f719ece.tar.xz
vo_gpu: vulkan: fix segfault due to index mismatch
The queue family index and the queue info index are not necessarily the same, so we're forced to do a check based on the queue family index itself. Fixes #5049
-rw-r--r--video/out/vulkan/utils.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/video/out/vulkan/utils.c b/video/out/vulkan/utils.c
index 5b9be3216f..1fd674d28f 100644
--- a/video/out/vulkan/utils.c
+++ b/video/out/vulkan/utils.c
@@ -519,14 +519,17 @@ bool mpvk_device_init(struct mpvk_ctx *vk, struct mpvk_device_opts opts)
if (!pool)
goto error;
MP_TARRAY_APPEND(NULL, vk->pools, vk->num_pools, pool);
- }
- vk->pool_graphics = vk->pools[idx_gfx];
- vk->pool_compute = idx_comp >= 0 ? vk->pools[idx_comp] : NULL;
- vk->pool_transfer = idx_tf >= 0 ? vk->pools[idx_tf] : NULL;
+ // Update the pool_* pointers based on the corresponding QF index
+ if (qf == idx_gfx)
+ vk->pool_graphics = pool;
+ if (qf == idx_comp)
+ vk->pool_compute = pool;
+ if (qf == idx_tf)
+ vk->pool_transfer = pool;
+ }
vk_malloc_init(vk);
-
talloc_free(tmp);
return true;