1
0
Fork 0
forked from wry/wry

vulkan: make async transfers generic over upload/download

This commit is contained in:
Julian Orth 2024-10-06 13:23:10 +02:00
parent 59f06dc208
commit 61c5ebb062
8 changed files with 148 additions and 63 deletions

View file

@ -1,6 +1,6 @@
use {
crate::{
gfx_api::{AsyncShmGfxTextureCallback, GfxError, PendingShmUpload, STAGING_UPLOAD},
gfx_api::{AsyncShmGfxTextureCallback, GfxError, PendingShmTransfer, STAGING_UPLOAD},
ifs::{
wl_buffer::WlBufferStorage,
wl_surface::{PendingState, WlSurface, WlSurfaceError},
@ -310,7 +310,7 @@ enum EntryKind {
enum ShmUploadState {
None,
Todo(Rc<NodeRef<Entry>>),
Scheduled(#[expect(dead_code)] SmallVec<[PendingShmUpload; 1]>),
Scheduled(#[expect(dead_code)] SmallVec<[PendingShmTransfer; 1]>),
}
struct Commit {
@ -395,7 +395,7 @@ fn schedule_async_uploads(
node_ref: &Rc<NodeRef<Entry>>,
surface: &WlSurface,
pending: &PendingState,
uploads: &mut SmallVec<[PendingShmUpload; 1]>,
uploads: &mut SmallVec<[PendingShmTransfer; 1]>,
) -> Result<(), WlSurfaceError> {
if let Some(pending) = schedule_async_upload(node_ref, surface, pending)? {
uploads.push(pending);
@ -412,7 +412,7 @@ fn schedule_async_upload(
node_ref: &Rc<NodeRef<Entry>>,
surface: &WlSurface,
pending: &PendingState,
) -> Result<Option<PendingShmUpload>, WlSurfaceError> {
) -> Result<Option<PendingShmTransfer>, WlSurfaceError> {
let Some(Some(buf)) = &pending.buffer else {
return Ok(None);
};