pub struct TimestampNormalizer {
state: Option<InternalState>,
}Expand description
Normalizes GPU timestamps to have a consistent 1GHz period. See module documentation for more information.
Fields§
§state: Option<InternalState>Implementations§
Source§impl TimestampNormalizer
impl TimestampNormalizer
Sourcepub fn new(
device: &Device,
timestamp_period: f32,
) -> Result<Self, TimestampNormalizerInitError>
pub fn new( device: &Device, timestamp_period: f32, ) -> Result<Self, TimestampNormalizerInitError>
Creates a new timestamp normalizer.
If the device cannot support automatic timestamp normalization, this will return a normalizer that does nothing.
§Errors
If any resources are invalid, this will return an error.
Sourcepub unsafe fn create_normalization_bind_group(
&self,
device: &Device,
buffer: &dyn DynBuffer,
buffer_label: Option<&str>,
buffer_size: BufferSize,
buffer_usages: BufferUsages,
) -> Result<TimestampNormalizationBindGroup, DeviceError>
pub unsafe fn create_normalization_bind_group( &self, device: &Device, buffer: &dyn DynBuffer, buffer_label: Option<&str>, buffer_size: BufferSize, buffer_usages: BufferUsages, ) -> Result<TimestampNormalizationBindGroup, DeviceError>
Create a bind group for normalizing timestamps in buffer.
buffer_size must be 4B-aligned, so that it is valid as a storage binding,
must be the same or more than the application-visible buffer size, and must
not overrun the buffer. This function is unsafe because it does not know and
cannot check whether buffer_size meets these requirements.
The buffer size passed here is used to construct a binding that must be
able to access the full application-visible range of the buffer. It is
not used to check the destination range of query resolution requests. That
uses the application-requested buffer size, obtained from the wgpu_core
Buffer.
pub fn normalize( &self, snatch_guard: &SnatchGuard<'_>, encoder: &mut dyn DynCommandEncoder, tracker: &mut BufferTracker, bind_group: &TimestampNormalizationBindGroup, buffer: &Arc<Buffer>, buffer_offset_bytes: u64, total_timestamps: u32, )
pub fn dispose(self, device: &dyn DynDevice)
pub fn enabled(&self) -> bool
Auto Trait Implementations§
impl Freeze for TimestampNormalizer
impl !RefUnwindSafe for TimestampNormalizer
impl Send for TimestampNormalizer
impl Sync for TimestampNormalizer
impl Unpin for TimestampNormalizer
impl UnsafeUnpin for TimestampNormalizer
impl !UnwindSafe for TimestampNormalizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more