1
0
Fork 0
forked from wry/wry

gfx: implement async shm downloads

This commit is contained in:
Julian Orth 2024-10-06 15:11:00 +02:00
parent aca14d48dd
commit 028d0ed44c
11 changed files with 194 additions and 198 deletions

View file

@ -23,7 +23,7 @@ use {
cpu_worker::{jobs::read_write::ReadWriteJobError, CpuWorker},
format::Format,
gfx_api::{
AsyncShmGfxTexture, GfxContext, GfxError, GfxFormat, GfxFramebuffer, GfxImage,
AsyncShmGfxTexture, GfxContext, GfxError, GfxFormat, GfxImage, GfxInternalFramebuffer,
GfxStagingBuffer, ResetStatus, ShmGfxTexture, StagingBufferUsecase, STAGING_DOWNLOAD,
STAGING_UPLOAD,
},
@ -316,16 +316,23 @@ impl GfxContext for Context {
GfxApi::Vulkan
}
fn create_fb(
fn create_internal_fb(
self: Rc<Self>,
cpu_worker: &Rc<CpuWorker>,
width: i32,
height: i32,
stride: i32,
format: &'static Format,
) -> Result<Rc<dyn GfxFramebuffer>, GfxError> {
let fb = self
.0
.create_shm_texture(format, width, height, stride, &[], true, None)?;
) -> Result<Rc<dyn GfxInternalFramebuffer>, GfxError> {
let fb = self.0.create_shm_texture(
format,
width,
height,
stride,
&[],
true,
Some(cpu_worker),
)?;
Ok(fb)
}