Skip to content
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

Rename timeout_us to timeout_ns, to match actual units. #2645

Merged
merged 1 commit into from
May 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ impl crate::Device<super::Api> for super::Device {
wait_value: crate::FenceValue,
timeout_ms: u32,
) -> Result<bool, crate::DeviceError> {
let timeout_us = timeout_ms as u64 * super::MILLIS_TO_NANOS;
let timeout_ns = timeout_ms as u64 * super::MILLIS_TO_NANOS;
match *fence {
super::Fence::TimelineSemaphore(raw) => {
let semaphores = [raw];
Expand All @@ -1787,10 +1787,10 @@ impl crate::Device<super::Api> for super::Device {
.values(&values);
let result = match self.shared.extension_fns.timeline_semaphore {
Some(super::ExtensionFn::Extension(ref ext)) => {
ext.wait_semaphores(&vk_info, timeout_us)
ext.wait_semaphores(&vk_info, timeout_ns)
}
Some(super::ExtensionFn::Promoted) => {
self.shared.raw.wait_semaphores(&vk_info, timeout_us)
self.shared.raw.wait_semaphores(&vk_info, timeout_ns)
}
None => unreachable!(),
};
Expand All @@ -1810,7 +1810,7 @@ impl crate::Device<super::Api> for super::Device {
} else {
match active.iter().find(|&&(value, _)| value >= wait_value) {
Some(&(_, raw)) => {
match self.shared.raw.wait_for_fences(&[raw], true, timeout_us) {
match self.shared.raw.wait_for_fences(&[raw], true, timeout_ns) {
Ok(()) => Ok(true),
Err(vk::Result::TIMEOUT) => Ok(false),
Err(other) => Err(other.into()),
Expand Down