mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 07:21:04 +01:00
[core] move normalize from Global into Queue::get_timestamp_period
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
60e606781c
commit
a3105e5bf9
2 files changed
+10
-6
No files matched your search
@@ -1841,10 +1841,18 @@ impl Queue {
|
||||
Ok(SubmissionResult { snatch_guard })
|
||||
}
|
||||
|
||||
pub fn get_timestamp_period(&self) -> f32 {
|
||||
pub(crate) fn get_raw_timestamp_period(&self) -> f32 {
|
||||
unsafe { self.raw().get_timestamp_period() }
|
||||
}
|
||||
|
||||
pub fn get_timestamp_period(&self) -> f32 {
|
||||
if self.device.timestamp_normalizer.get().unwrap().enabled() {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
self.get_raw_timestamp_period()
|
||||
}
|
||||
|
||||
/// `closure` is guaranteed to be called.
|
||||
pub fn on_submitted_work_done(
|
||||
&self,
|
||||
@@ -2101,10 +2109,6 @@ impl Global {
|
||||
pub fn queue_get_timestamp_period(&self, queue_id: QueueId) -> f32 {
|
||||
let queue = self.hub.queues.get(queue_id);
|
||||
|
||||
if queue.device.timestamp_normalizer.get().unwrap().enabled() {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
queue.get_timestamp_period()
|
||||
}
|
||||
|
||||
|
||||
@@ -765,7 +765,7 @@ impl Device {
|
||||
|
||||
let timestamp_normalizer = crate::timestamp_normalization::TimestampNormalizer::new(
|
||||
self,
|
||||
queue.get_timestamp_period(),
|
||||
queue.get_raw_timestamp_period(),
|
||||
)?;
|
||||
|
||||
self.timestamp_normalizer
|
||||
|
||||
Reference in new issue
Block a user