Improve submit info

This commit is contained in:
hodasemi 2023-12-04 12:41:10 +01:00
parent 492ec7ff04
commit 9130e0d8df

View file

@ -207,19 +207,20 @@ pub struct SubmitInfo {
} }
impl SubmitInfo { impl SubmitInfo {
pub fn add_wait_semaphore(mut self, wait_semaphore: impl VkHandle<VkSemaphore>) -> Self { pub fn add_wait_semaphore(
self.wait_semaphores.push(wait_semaphore.vk_handle()); self,
wait_semaphore: impl VkHandle<VkSemaphore>,
self wait_stage: impl Into<VkPipelineStageFlagBits>,
) -> Self {
self.add_wait_semaphore_vk(wait_semaphore.vk_handle(), wait_stage)
} }
pub fn add_wait_semaphore_vk(mut self, wait_semaphore: VkSemaphore) -> Self { pub fn add_wait_semaphore_vk(
mut self,
wait_semaphore: VkSemaphore,
wait_stage: impl Into<VkPipelineStageFlagBits>,
) -> Self {
self.wait_semaphores.push(wait_semaphore); self.wait_semaphores.push(wait_semaphore);
self
}
pub fn add_wait_stage(mut self, wait_stage: impl Into<VkPipelineStageFlagBits>) -> Self {
self.wait_stages.push(wait_stage.into()); self.wait_stages.push(wait_stage.into());
self self
@ -231,10 +232,8 @@ impl SubmitInfo {
self self
} }
pub fn add_signal_semaphore(mut self, signal_semaphore: impl VkHandle<VkSemaphore>) -> Self { pub fn add_signal_semaphore(self, signal_semaphore: impl VkHandle<VkSemaphore>) -> Self {
self.signal_semaphores.push(signal_semaphore.vk_handle()); self.add_signal_semaphore_vk(signal_semaphore.vk_handle())
self
} }
pub fn add_signal_semaphore_vk(mut self, signal_semaphore: VkSemaphore) -> Self { pub fn add_signal_semaphore_vk(mut self, signal_semaphore: VkSemaphore) -> Self {