-
Notifications
You must be signed in to change notification settings - Fork 953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to notify with Queue::submit() to Vulkan's vk::Semaphore allocated outside of wgpu #6813
base: trunk
Are you sure you want to change the base?
Conversation
wgpu-hal/src/vulkan/mod.rs
Outdated
&self.device.raw | ||
} | ||
|
||
pub fn add_signal_semahore(&self, semaphore: vk::Semaphore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/semahore/semaphore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
wgpu-core/src/resource.rs
Outdated
/// # Safety | ||
/// | ||
/// - The raw queue handle must not be manually destroyed | ||
pub unsafe fn queue_as_hal<A: HalApi, F: FnOnce(Option<&A::Queue>) -> R, R>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: lets use a where
here, as the expressions are complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit on top of nit: all other as_hal()
functions have the bound directly on the type definition, it would be more consistent to keep it or replace it across the code-base atomically?
@@ -1210,6 +1211,11 @@ impl crate::Queue for Queue { | |||
signal_values.push(!0); | |||
} | |||
|
|||
let mut pending_signal_semaphores = self.signal_semaphores.lock(); | |||
if !pending_signal_semaphores.is_empty() { | |||
signal_semaphores.append(&mut pending_signal_semaphores); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to push to signal_values or you'll throw a validation error as the values/semaphores won't be matched up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to apply the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the caller wants to signal a timeline semaphore? Perhaps additional semaphore values should be exposed as well?
Connections
Fixes #6812
Description
The following changes are done.