vulkan: attach last-use-syncfile to internal framebuffers
This commit is contained in:
parent
cc8db84289
commit
901a0fe93a
3 changed files with 11 additions and 4 deletions
|
|
@ -824,11 +824,18 @@ impl VulkanRenderer {
|
||||||
if attach_async_shm_sync_file {
|
if attach_async_shm_sync_file {
|
||||||
if let VulkanImageMemory::Internal(shm) = &texture.tex.ty {
|
if let VulkanImageMemory::Internal(shm) = &texture.tex.ty {
|
||||||
if let Some(data) = &shm.async_data {
|
if let Some(data) = &shm.async_data {
|
||||||
data.last_sample.set(Some(sync_file.clone()));
|
data.last_gfx_use.set(Some(sync_file.clone()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if attach_async_shm_sync_file {
|
||||||
|
if let VulkanImageMemory::Internal(shm) = &fb.ty {
|
||||||
|
if let Some(data) = &shm.async_data {
|
||||||
|
data.last_gfx_use.set(Some(sync_file.clone()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
import(fb, fb_release_sync, None, DMA_BUF_SYNC_WRITE);
|
import(fb, fb_release_sync, None, DMA_BUF_SYNC_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,7 @@ impl VulkanRenderer {
|
||||||
callback_id: Cell::new(0),
|
callback_id: Cell::new(0),
|
||||||
regions: Default::default(),
|
regions: Default::default(),
|
||||||
cpu: cpu.clone(),
|
cpu: cpu.clone(),
|
||||||
last_sample: Default::default(),
|
last_gfx_use: Default::default(),
|
||||||
data_copied: Default::default(),
|
data_copied: Default::default(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ pub struct VulkanShmImageAsyncData {
|
||||||
pub(super) callback_id: Cell<u64>,
|
pub(super) callback_id: Cell<u64>,
|
||||||
pub(super) regions: RefCell<Vec<BufferImageCopy2<'static>>>,
|
pub(super) regions: RefCell<Vec<BufferImageCopy2<'static>>>,
|
||||||
pub(super) cpu: Rc<CpuWorker>,
|
pub(super) cpu: Rc<CpuWorker>,
|
||||||
pub(super) last_sample: Cell<Option<SyncFile>>,
|
pub(super) last_gfx_use: Cell<Option<SyncFile>>,
|
||||||
pub(super) data_copied: Cell<bool>,
|
pub(super) data_copied: Cell<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -215,7 +215,7 @@ impl VulkanShmImage {
|
||||||
img.renderer.check_defunct()?;
|
img.renderer.check_defunct()?;
|
||||||
let Some(transfer_queue_idx) = img.renderer.device.distinct_transfer_queue_family_idx
|
let Some(transfer_queue_idx) = img.renderer.device.distinct_transfer_queue_family_idx
|
||||||
else {
|
else {
|
||||||
let Some(sync_file) = data.last_sample.take() else {
|
let Some(sync_file) = data.last_gfx_use.take() else {
|
||||||
img.queue_state.set(QueueState::Released {
|
img.queue_state.set(QueueState::Released {
|
||||||
to: QueueFamily::Transfer,
|
to: QueueFamily::Transfer,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue