1
0
Fork 0
forked from wry/wry

metal: implement direct scanout

This commit is contained in:
Julian Orth 2024-02-18 20:29:23 +01:00
parent fed2ceb8b5
commit da84e9ec27
25 changed files with 682 additions and 148 deletions

View file

@ -1,7 +1,7 @@
use {
crate::{
format::Format,
gfx_api::{GfxApiOpt, GfxError, GfxFramebuffer, GfxImage, GfxTexture},
gfx_api::{GfxApiOpt, GfxError, GfxFramebuffer, GfxImage, GfxTexture, TextureReservations},
gfx_apis::vulkan::{
allocator::VulkanAllocation, device::VulkanDevice, format::VulkanMaxExtents,
renderer::VulkanRenderer, util::OnDrop, VulkanError,
@ -53,6 +53,7 @@ pub struct VulkanImage {
pub(super) is_undefined: Cell<bool>,
pub(super) ty: VulkanImageMemory,
pub(super) render_ops: CloneCell<Vec<GfxApiOpt>>,
pub(super) resv: TextureReservations,
}
pub enum VulkanImageMemory {
@ -211,6 +212,7 @@ impl VulkanRenderer {
is_undefined: Cell::new(true),
ty: VulkanImageMemory::Internal(shm),
render_ops: Default::default(),
resv: Default::default(),
}))
}
@ -480,6 +482,7 @@ impl VulkanDmaBufImageTemplate {
}),
format: self.dmabuf.format,
is_undefined: Cell::new(true),
resv: Default::default(),
}))
}
}
@ -580,4 +583,8 @@ impl GfxTexture for VulkanImage {
VulkanImageMemory::Internal(_) => None,
}
}
fn reservations(&self) -> &TextureReservations {
&self.resv
}
}