mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 23:11:01 +01:00
Force wait for GPU before releasing the old swapchain
This commit is contained in:
1 parent
564070b56c
commit
ecaacfa20e
1 file changed
+4
-1
@@ -1515,14 +1515,17 @@ pub fn device_create_swap_chain(
|
||||
config.format, formats);
|
||||
}
|
||||
//TODO: properly exclusive range
|
||||
/* TODO: this is way too restrictive
|
||||
assert!(desc.width >= caps.extents.start.width && desc.width <= caps.extents.end.width &&
|
||||
desc.height >= caps.extents.start.height && desc.height <= caps.extents.end.height,
|
||||
"Requested size {}x{} is outside of the supported range: {:?}",
|
||||
desc.width, desc.height, caps.extents);
|
||||
|
||||
*/
|
||||
|
||||
let (old_raw, sem_available, command_pool) = match surface.swap_chain.take() {
|
||||
Some(mut old) => {
|
||||
//TODO: remove this once gfx-rs stops destroying the old swapchain
|
||||
device.raw.wait_idle().unwrap();
|
||||
let mut destroyed = device.destroyed.lock();
|
||||
assert_eq!(old.device_id.value, device_id);
|
||||
for frame in old.frames {
|
||||
|
||||
Reference in new issue
Block a user