Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use VkDevice from multiple threads concurrently?

Tags:

vulkan

In particular, can I create pipelines, allocate device memory and create images and buffers from the same VkDevice concurrently?

Where in the specs this is specified?

like image 255
lvella Avatar asked Dec 16 '25 12:12

lvella


1 Answers

In the specification we can read:

Vulkan is intended to provide scalable performance when used on multiple host threads. All commands support being called concurrently from multiple threads, but certain parameters, or components of parameters are defined to be externally synchronized. This means that the caller must guarantee that no more than one thread is using such a parameter at a given time.

Then there is a list of parameters of different Vulkan functions in which they must be externally synchronized (meaning they cannot be accessed at the same time from multiple threads). In case of a VkDevice objects, we can find that only vkDestroyDevice(). So all other usages of a VkDevice objects can happen on multiple threads.

And there are practically no vkCreate...() functions in that list (only 3 swapchain related functions). Which means you can create objects from multiple threads at the same time.

like image 77
Ekzuzy Avatar answered Dec 19 '25 05:12

Ekzuzy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!