mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
Turn off reuse of command buffers for now
It worked ok on Vulkan but is causing problems on DX12 and Metal. Punt for now and come back to this later when we do more sophisticated resource management.
This commit is contained in:
parent
87a84eb490
commit
074fafad1e
|
@ -459,14 +459,12 @@ impl crate::backend::CmdBuf<Dx12Device> for CmdBuf {
|
|||
// This is a bit of a mess. Returning the allocator to the free pool
|
||||
// makes sense if the command list will be dropped, but not if it will
|
||||
// be reused. Probably need to implement some logic on drop.
|
||||
/*
|
||||
if let Some(free_allocators) = self.free_allocators.upgrade() {
|
||||
free_allocators
|
||||
.lock()
|
||||
.unwrap()
|
||||
.push(self.allocator.take().unwrap());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
unsafe fn dispatch(
|
||||
|
|
|
@ -169,6 +169,11 @@ impl Session {
|
|||
let mut item = pending.swap_remove(i);
|
||||
// TODO: wait is superfluous, can just reset
|
||||
let _ = self.0.device.wait_and_reset(vec![&mut item.fence]);
|
||||
|
||||
// Reuse of command buffers works on Vulkan, but not at all on
|
||||
// Metal and is problematic on DX12 (the allocator is returned)
|
||||
// to the pool. Punt for now.
|
||||
/*
|
||||
let mut pool = self.0.cmd_buf_pool.lock().unwrap();
|
||||
pool.push((item.cmd_buf, item.fence));
|
||||
std::mem::drop(item.resources);
|
||||
|
@ -176,6 +181,7 @@ impl Session {
|
|||
pool.push((staging_cmd_buf.cmd_buf, staging_cmd_buf.fence));
|
||||
std::mem::drop(staging_cmd_buf.resources);
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
i += 1;
|
||||
}
|
||||
|
@ -562,11 +568,14 @@ impl SubmittedCmdBuf {
|
|||
unsafe {
|
||||
session.device.wait_and_reset(vec![&mut item.fence])?;
|
||||
}
|
||||
// See discussion in `poll_cleanup`
|
||||
/*
|
||||
session
|
||||
.cmd_buf_pool
|
||||
.lock()
|
||||
.unwrap()
|
||||
.push((item.cmd_buf, item.fence));
|
||||
*/
|
||||
std::mem::drop(item.resources);
|
||||
}
|
||||
// else session dropped error?
|
||||
|
|
Loading…
Reference in a new issue