nak/nir: Fix the reverse execlist iterator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30402>
This commit is contained in:

committed by
Marge Bot

parent
d19ea8524b
commit
f66ca6edc3
@@ -73,15 +73,20 @@ impl<'a, T: 'a> Iterator for ExecListIter<'a, T> {
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.rev {
|
||||
self.n = unsafe { &*self.n.prev };
|
||||
if self.n.prev.is_null() {
|
||||
None
|
||||
} else {
|
||||
let t: *const c_void = (self.n as *const exec_node).cast();
|
||||
Some(unsafe { &*(t.sub(self.offset).cast()) })
|
||||
}
|
||||
} else {
|
||||
self.n = unsafe { &*self.n.next };
|
||||
}
|
||||
|
||||
if self.n.next.is_null() {
|
||||
None
|
||||
} else {
|
||||
let t: *const c_void = (self.n as *const exec_node).cast();
|
||||
Some(unsafe { &*(t.sub(self.offset).cast()) })
|
||||
if self.n.next.is_null() {
|
||||
None
|
||||
} else {
|
||||
let t: *const c_void = (self.n as *const exec_node).cast();
|
||||
Some(unsafe { &*(t.sub(self.offset).cast()) })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user