mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-02-02 03:45:55 +00:00
feat(frame-pacing): submit command buffers from optional queue
This commit is contained in:
parent
e1f89cc1da
commit
dec803f98d
2 changed files with 4 additions and 3 deletions
|
|
@ -84,13 +84,14 @@ namespace vk {
|
|||
/// @param signalTimelineSemaphore the timeline semaphore to signal
|
||||
/// @param signalValue the value to signal
|
||||
/// @param fence optional fence to signal on completion
|
||||
/// @param queue optional queue to submit to
|
||||
/// @throws ls::vulkan_error on failure
|
||||
void submit(const vk::Vulkan& vk,
|
||||
std::vector<VkSemaphore> waitSemaphores,
|
||||
VkSemaphore waitTimelineSemaphore, uint64_t waitValue,
|
||||
std::vector<VkSemaphore> signalSemaphores,
|
||||
VkSemaphore signalTimelineSemaphore, uint64_t signalValue,
|
||||
VkFence fence = VK_NULL_HANDLE) const;
|
||||
VkFence fence = VK_NULL_HANDLE, VkQueue queue = VK_NULL_HANDLE) const;
|
||||
|
||||
/// submit the command buffer instantly
|
||||
/// @param vk the vulkan instance
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ void CommandBuffer::submit(const vk::Vulkan& vk,
|
|||
VkSemaphore waitTimelineSemaphore, uint64_t waitValue,
|
||||
std::vector<VkSemaphore> signalSemaphores,
|
||||
VkSemaphore signalTimelineSemaphore, uint64_t signalValue,
|
||||
VkFence fence) const {
|
||||
VkFence fence, VkQueue queue) const {
|
||||
// create arrays of semaphores and values
|
||||
if (waitTimelineSemaphore)
|
||||
waitSemaphores.push_back(waitTimelineSemaphore);
|
||||
|
|
@ -239,7 +239,7 @@ void CommandBuffer::submit(const vk::Vulkan& vk,
|
|||
.signalSemaphoreCount = static_cast<uint32_t>(signalSemaphores.size()),
|
||||
.pSignalSemaphores = signalSemaphores.data()
|
||||
};
|
||||
auto res = vk.df().QueueSubmit(vk.queue(), 1, &submitInfo, fence);
|
||||
auto res = vk.df().QueueSubmit(queue ? queue : vk.queue(), 1, &submitInfo, fence);
|
||||
if (res != VK_SUCCESS)
|
||||
throw ls::vulkan_error(res, "vkQueueSubmit() failed");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue