rusticl: Wire the 'queued' profiling time up
Set it from the timestamp when it's added to the queue, and wire the API up to read it. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
This commit is contained in:
committed by
Marge Bot
parent
6052e58bf6
commit
85ca349be0
@@ -50,7 +50,7 @@ impl CLInfo<cl_profiling_info> for cl_event {
|
||||
|
||||
Ok(match *q {
|
||||
// TODO
|
||||
CL_PROFILING_COMMAND_QUEUED => cl_prop::<cl_ulong>(0),
|
||||
CL_PROFILING_COMMAND_QUEUED => cl_prop::<cl_ulong>(event.get_time(EventTimes::Queued)),
|
||||
CL_PROFILING_COMMAND_SUBMIT => cl_prop::<cl_ulong>(1),
|
||||
CL_PROFILING_COMMAND_START => cl_prop::<cl_ulong>(2),
|
||||
CL_PROFILING_COMMAND_END => cl_prop::<cl_ulong>(3),
|
||||
|
||||
@@ -118,6 +118,9 @@ impl Queue {
|
||||
}
|
||||
|
||||
pub fn queue(&self, e: Arc<Event>) {
|
||||
if self.is_profiling_enabled() {
|
||||
e.set_time(EventTimes::Queued, self.device.screen().get_timestamp());
|
||||
}
|
||||
self.state.lock().unwrap().pending.push(e);
|
||||
}
|
||||
|
||||
@@ -149,6 +152,10 @@ impl Queue {
|
||||
queues.remove(self);
|
||||
queues
|
||||
}
|
||||
|
||||
pub fn is_profiling_enabled(&self) -> bool {
|
||||
(self.props & (CL_QUEUE_PROFILING_ENABLE as u64)) != 0
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Queue {
|
||||
|
||||
Reference in New Issue
Block a user