mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-04-27 21:01:41 +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 signalTimelineSemaphore the timeline semaphore to signal
|
||||||
/// @param signalValue the value to signal
|
/// @param signalValue the value to signal
|
||||||
/// @param fence optional fence to signal on completion
|
/// @param fence optional fence to signal on completion
|
||||||
|
/// @param queue optional queue to submit to
|
||||||
/// @throws ls::vulkan_error on failure
|
/// @throws ls::vulkan_error on failure
|
||||||
void submit(const vk::Vulkan& vk,
|
void submit(const vk::Vulkan& vk,
|
||||||
std::vector<VkSemaphore> waitSemaphores,
|
std::vector<VkSemaphore> waitSemaphores,
|
||||||
VkSemaphore waitTimelineSemaphore, uint64_t waitValue,
|
VkSemaphore waitTimelineSemaphore, uint64_t waitValue,
|
||||||
std::vector<VkSemaphore> signalSemaphores,
|
std::vector<VkSemaphore> signalSemaphores,
|
||||||
VkSemaphore signalTimelineSemaphore, uint64_t signalValue,
|
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
|
/// submit the command buffer instantly
|
||||||
/// @param vk the vulkan instance
|
/// @param vk the vulkan instance
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ void CommandBuffer::submit(const vk::Vulkan& vk,
|
||||||
VkSemaphore waitTimelineSemaphore, uint64_t waitValue,
|
VkSemaphore waitTimelineSemaphore, uint64_t waitValue,
|
||||||
std::vector<VkSemaphore> signalSemaphores,
|
std::vector<VkSemaphore> signalSemaphores,
|
||||||
VkSemaphore signalTimelineSemaphore, uint64_t signalValue,
|
VkSemaphore signalTimelineSemaphore, uint64_t signalValue,
|
||||||
VkFence fence) const {
|
VkFence fence, VkQueue queue) const {
|
||||||
// create arrays of semaphores and values
|
// create arrays of semaphores and values
|
||||||
if (waitTimelineSemaphore)
|
if (waitTimelineSemaphore)
|
||||||
waitSemaphores.push_back(waitTimelineSemaphore);
|
waitSemaphores.push_back(waitTimelineSemaphore);
|
||||||
|
|
@ -239,7 +239,7 @@ void CommandBuffer::submit(const vk::Vulkan& vk,
|
||||||
.signalSemaphoreCount = static_cast<uint32_t>(signalSemaphores.size()),
|
.signalSemaphoreCount = static_cast<uint32_t>(signalSemaphores.size()),
|
||||||
.pSignalSemaphores = signalSemaphores.data()
|
.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)
|
if (res != VK_SUCCESS)
|
||||||
throw ls::vulkan_error(res, "vkQueueSubmit() failed");
|
throw ls::vulkan_error(res, "vkQueueSubmit() failed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue