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:
Niklas Haas 2017-10-28 16:02:08 +02:00 committed by Martin Herkt
parent 12c6700a3c
commit d588bdaaf7
1 changed files with 8 additions and 5 deletions

View File

@ -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;