perf counter for render

This commit is contained in:
🪞👃🪞 2025-01-14 16:45:58 +01:00
parent c9677c87d8
commit 1b7f0e0b93
17 changed files with 331 additions and 358 deletions

View file

@ -20,3 +20,13 @@ pub trait HasSampler {
))
}
}
#[macro_export] macro_rules! has_sampler {
(|$self:ident:$Struct:ty| { sampler = $e0:expr; index = $e1:expr; }) => {
impl HasSampler for $Struct {
fn sampler (&$self) -> &Option<Sampler> { &$e0 }
fn sampler_mut (&mut $self) -> &mut Option<Sampler> { &mut $e0 }
fn sample_index (&$self) -> usize { $e1 }
}
}
}