mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
nak: Add more NIR wrappers for walking the NIR CFG
Reviewed-by: M Henning <drawoc@darkrefraction.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28300>
This commit is contained in:
parent
9312356d99
commit
8e7f33818f
1 changed files with 15 additions and 0 deletions
|
|
@ -44,6 +44,14 @@ impl<'a, T> ExecListIter<'a, T> {
|
|||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
fn at(n: &'a exec_node, offset: usize) -> Self {
|
||||
Self {
|
||||
n,
|
||||
offset: offset,
|
||||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: 'a> Iterator for ExecListIter<'a, T> {
|
||||
|
|
@ -556,6 +564,7 @@ pub trait NirCfNode {
|
|||
fn as_block(&self) -> Option<&nir_block>;
|
||||
fn as_if(&self) -> Option<&nir_if>;
|
||||
fn as_loop(&self) -> Option<&nir_loop>;
|
||||
fn next(&self) -> Option<&nir_cf_node>;
|
||||
}
|
||||
|
||||
impl NirCfNode for nir_cf_node {
|
||||
|
|
@ -582,6 +591,12 @@ impl NirCfNode for nir_cf_node {
|
|||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn next(&self) -> Option<&nir_cf_node> {
|
||||
let mut iter: ExecListIter<nir_cf_node> =
|
||||
ExecListIter::at(&self.node, offset_of!(nir_cf_node, node));
|
||||
iter.next()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait NirFunctionImpl {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue