mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 04:42:10 +00:00
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
This commit is contained in:
parent
12c6700a3c
commit
d588bdaaf7
@ -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);
|
||||
|
||||
// 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->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;
|
||||
|
||||
vk_malloc_init(vk);
|
||||
|
||||
talloc_free(tmp);
|
||||
return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user