1
0
Fork 0
forked from wry/wry

vulkan: import wl_shm buffers as udmabuf

This commit is contained in:
Julian Orth 2025-09-30 18:52:57 +02:00
parent 47e15c6083
commit a3d3a62af3
14 changed files with 545 additions and 99 deletions

View file

@ -665,6 +665,8 @@ pub trait GfxStagingBuffer: Any {
fn size(&self) -> usize;
}
pub trait GfxBuffer: Any {}
pub trait AsyncShmGfxTextureTransferCancellable {
fn cancel(&self, id: u64);
}
@ -713,6 +715,22 @@ pub trait AsyncShmGfxTexture: GfxTexture {
damage: Region,
) -> Result<Option<PendingShmTransfer>, GfxError>;
fn async_upload_from_buffer(
self: Rc<Self>,
buf: &Rc<dyn GfxBuffer>,
callback: Rc<dyn AsyncShmGfxTextureCallback>,
damage: Region,
) -> Result<Option<PendingShmTransfer>, GfxError> {
let _ = buf;
let _ = callback;
let _ = damage;
#[derive(Debug, Error)]
#[error("Host buffers are not supported")]
struct E;
Err(GfxError(Box::new(E)))
}
fn sync_upload(self: Rc<Self>, shm: &[Cell<u8>], damage: Region) -> Result<(), GfxError>;
fn compatible_with(
@ -800,6 +818,22 @@ pub trait GfxContext: Debug {
fn supports_invalid_modifier(&self) -> bool {
false
}
fn create_dmabuf_buffer(
&self,
dmabuf: &Rc<OwnedFd>,
offset: usize,
size: usize,
) -> Result<Rc<dyn GfxBuffer>, GfxError> {
let _ = dmabuf;
let _ = offset;
let _ = size;
#[derive(Debug, Error)]
#[error("Host buffers are not supported")]
struct E;
Err(GfxError(Box::new(E)))
}
}
#[derive(Clone, Debug)]