1
0
Fork 0
forked from wry/wry

metal: track per-framebuffer damage

This commit is contained in:
Julian Orth 2025-02-18 16:43:30 +01:00
parent f80ac20220
commit 07fb198eb4
17 changed files with 334 additions and 151 deletions

View file

@ -11,7 +11,13 @@ use {
RectRaw,
},
smallvec::SmallVec,
std::{cell::UnsafeCell, mem, ops::Deref, rc::Rc},
std::{
cell::UnsafeCell,
fmt::{Debug, Formatter},
mem,
ops::Deref,
rc::Rc,
},
};
thread_local! {
@ -196,6 +202,12 @@ pub struct DamageQueue {
datas: Rc<UnsafeCell<Vec<Vec<Rect>>>>,
}
impl Debug for DamageQueue {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("DamageQueue").finish_non_exhaustive()
}
}
impl DamageQueue {
pub fn new<const N: usize>() -> [DamageQueue; N] {
let datas = Rc::new(UnsafeCell::new(vec![vec!(); N]));