pub struct GpuSpan { /* private fields */ }
Expand description
Span for timing gpu work.
See the context level documentation for more information on use.
If the span is dropped early, the following happens:
- If the span has not been ended, the span is ended. AND
- If the span has not had values uploaded, the span is uploaded with the timestamps marking the start of the current gpu context. This will put the span out of the way of other spans.
Implementations§
Source§impl GpuSpan
impl GpuSpan
Sourcepub fn end_zone(&mut self)
pub fn end_zone(&mut self)
Marks the end of the given gpu span. This should be called right next to where you record the corresponding gpu timestamp for the end of the span. This allows tracy to correctly associate the cpu time with the gpu timestamp.
Only the first time you call this function will it actually emit a gpu zone end event. Any subsequent calls will be ignored.
Sourcepub fn upload_timestamp_start(&self, start_timestamp: i64)
pub fn upload_timestamp_start(&self, start_timestamp: i64)
Supplies the GPU timestamp for the start of this span.
In order to avoid confusing Tracy, you must call
Self::upload_timestamp_start
and Self::upload_timestamp_end
in
monotonically increasing timestamp order. For example, if you have two
nested spans outer and inner, you must supply the timestamps in
this order: (1) outer start; (2) inner start; (3) inner end; (4)
outer end.
Sourcepub fn upload_timestamp_end(&self, end_timestamp: i64)
pub fn upload_timestamp_end(&self, end_timestamp: i64)
Supplies the GPU timestamp for the end of this span.
In order to avoid confusing Tracy, you must call
Self::upload_timestamp_start
and Self::upload_timestamp_end
in
monotonically increasing timestamp order. For example, if you have two
nested spans outer and inner, you must supply the timestamps in this
order: (1) outer start; (2) inner start; (3) inner end; (4)
outer end.