mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01:00
rusticl/queue: format file
Reviewed-by: @LingMan Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30215>
This commit is contained in:
parent
00540594df
commit
bcc79499fa
1 changed files with 53 additions and 53 deletions
|
|
@ -137,64 +137,64 @@ impl Queue {
|
||||||
// GPU contexts
|
// GPU contexts
|
||||||
let mut last_err = CL_SUCCESS as cl_int;
|
let mut last_err = CL_SUCCESS as cl_int;
|
||||||
loop {
|
loop {
|
||||||
let r = rx_t.recv();
|
let r = rx_t.recv();
|
||||||
if r.is_err() {
|
if r.is_err() {
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
let new_events = r.unwrap();
|
|
||||||
let mut flushed = Vec::new();
|
|
||||||
|
|
||||||
for e in new_events {
|
|
||||||
// If we hit any deps from another queue, flush so we don't risk a dead
|
|
||||||
// lock.
|
|
||||||
if e.deps.iter().any(|ev| ev.queue != e.queue) {
|
|
||||||
flush_events(&mut flushed, &ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if any dependency has an error
|
let new_events = r.unwrap();
|
||||||
for dep in &e.deps {
|
let mut flushed = Vec::new();
|
||||||
// We have to wait on user events or events from other queues.
|
|
||||||
let dep_err = if dep.is_user() || dep.queue != e.queue {
|
for e in new_events {
|
||||||
dep.wait()
|
// If we hit any deps from another queue, flush so we don't risk a dead
|
||||||
|
// lock.
|
||||||
|
if e.deps.iter().any(|ev| ev.queue != e.queue) {
|
||||||
|
flush_events(&mut flushed, &ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if any dependency has an error
|
||||||
|
for dep in &e.deps {
|
||||||
|
// We have to wait on user events or events from other queues.
|
||||||
|
let dep_err = if dep.is_user() || dep.queue != e.queue {
|
||||||
|
dep.wait()
|
||||||
|
} else {
|
||||||
|
dep.status()
|
||||||
|
};
|
||||||
|
|
||||||
|
last_err = cmp::min(last_err, dep_err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if last_err < 0 {
|
||||||
|
// If a dependency failed, fail this event as well.
|
||||||
|
e.set_user_status(last_err);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there is an execution error don't bother signaling it as the context
|
||||||
|
// might be in a broken state. How queues behave after any event hit an
|
||||||
|
// error is entirely implementation defined.
|
||||||
|
last_err = e.call(&ctx);
|
||||||
|
if last_err < 0 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if e.is_user() {
|
||||||
|
// On each user event we flush our events as application might
|
||||||
|
// wait on them before signaling user events.
|
||||||
|
flush_events(&mut flushed, &ctx);
|
||||||
|
|
||||||
|
// Wait on user events as they are synchronization points in the
|
||||||
|
// application's control.
|
||||||
|
e.wait();
|
||||||
|
} else if Platform::dbg().sync_every_event {
|
||||||
|
flushed.push(e);
|
||||||
|
flush_events(&mut flushed, &ctx);
|
||||||
} else {
|
} else {
|
||||||
dep.status()
|
flushed.push(e);
|
||||||
};
|
}
|
||||||
|
|
||||||
last_err = cmp::min(last_err, dep_err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if last_err < 0 {
|
flush_events(&mut flushed, &ctx);
|
||||||
// If a dependency failed, fail this event as well.
|
|
||||||
e.set_user_status(last_err);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if there is an execution error don't bother signaling it as the context
|
|
||||||
// might be in a broken state. How queues behave after any event hit an
|
|
||||||
// error is entirely implementation defined.
|
|
||||||
last_err = e.call(&ctx);
|
|
||||||
if last_err < 0 {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if e.is_user() {
|
|
||||||
// On each user event we flush our events as application might
|
|
||||||
// wait on them before signaling user events.
|
|
||||||
flush_events(&mut flushed, &ctx);
|
|
||||||
|
|
||||||
// Wait on user events as they are synchronization points in the
|
|
||||||
// application's control.
|
|
||||||
e.wait();
|
|
||||||
} else if Platform::dbg().sync_every_event {
|
|
||||||
flushed.push(e);
|
|
||||||
flush_events(&mut flushed, &ctx);
|
|
||||||
} else {
|
|
||||||
flushed.push(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flush_events(&mut flushed, &ctx);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue