1
0
Fork 0
forked from wry/wry

wl-shm: add support for more formats

This commit is contained in:
Julian Orth 2025-10-01 20:31:00 +02:00
parent 09a56edd47
commit 0570669af2
20 changed files with 114 additions and 81 deletions

View file

@ -824,10 +824,12 @@ pub trait GfxContext: Debug {
dmabuf: &OwnedFd,
offset: usize,
size: usize,
format: &'static Format,
) -> Result<Rc<dyn GfxBuffer>, GfxError> {
let _ = dmabuf;
let _ = offset;
let _ = size;
let _ = format;
#[derive(Debug, Error)]
#[error("Host buffers are not supported")]
@ -850,6 +852,7 @@ pub struct GfxFormat {
pub format: &'static Format,
pub read_modifiers: IndexSet<Modifier>,
pub write_modifiers: IndexMap<Modifier, GfxWriteModifier>,
pub supports_shm: bool,
}
#[derive(Error)]
@ -879,6 +882,7 @@ impl GfxFormat {
.map(|(m, v)| (*m, v.clone()))
.filter(|(m, _)| other.read_modifiers.contains(m))
.collect(),
supports_shm: self.supports_shm && other.supports_shm,
}
}
}