diff options
author | Simon Ser <contact@emersion.fr> | 2022-11-04 16:54:49 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-11-11 19:18:04 +0000 |
commit | f1eae0eeebcae0eed8754f6c6db0a14cf8ad401f (patch) | |
tree | abd92e52f98b2e69bed59aa788f1b812f0b1bff1 /render/vulkan/vulkan.c | |
parent | a8a194d695af9df4761bd894174134704ae7cebb (diff) |
render/vulkan: add a command buffer pool
Before re-using a VkCommandBuffer, we need to wait for its
operations to complete. Right now we unconditionally wait for
rendering to complete in vulkan_end(), however we have plans to
fix this [1]. To fully avoid blocking, we need to handle multiple
command buffers in flight at the same time (e.g. for multi-output,
or for rendering followed by texture uploads).
Implement a pool of command buffers. When we need to render, we
pick a command buffer from the pool which has completed its
operations. If we don't find one, try to allocate a new command
buffer. If we don't have slots in the pool anymore, block like we
did before.
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3574
Diffstat (limited to 'render/vulkan/vulkan.c')
-rw-r--r-- | render/vulkan/vulkan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/render/vulkan/vulkan.c b/render/vulkan/vulkan.c index 2163118b..748ba9c3 100644 --- a/render/vulkan/vulkan.c +++ b/render/vulkan/vulkan.c @@ -489,6 +489,8 @@ struct wlr_vk_device *vulkan_device_create(struct wlr_vk_instance *ini, load_device_proc(dev, "vkGetMemoryFdPropertiesKHR", &dev->api.getMemoryFdPropertiesKHR); load_device_proc(dev, "vkWaitSemaphoresKHR", &dev->api.waitSemaphoresKHR); + load_device_proc(dev, "vkGetSemaphoreCounterValueKHR", + &dev->api.getSemaphoreCounterValueKHR); // - check device format support - size_t max_fmts; |