mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'capucho/gpu-poll' into 'master'
cleanup gpu resources on maintain See merge request veloren/veloren!2466
This commit is contained in:
commit
6097bf0b1d
@ -80,6 +80,7 @@ impl GlobalState {
|
||||
pub fn maintain(&mut self, dt: std::time::Duration) {
|
||||
span!(_guard, "maintain", "GlobalState::maintain");
|
||||
self.audio.maintain(dt);
|
||||
self.window.renderer().maintain()
|
||||
}
|
||||
|
||||
#[cfg(feature = "singleplayer")]
|
||||
|
@ -600,6 +600,14 @@ impl Renderer {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn maintain(&self) {
|
||||
if self.is_minimized {
|
||||
self.queue.submit(std::iter::empty());
|
||||
}
|
||||
|
||||
self.device.poll(wgpu::Maintain::Poll)
|
||||
}
|
||||
|
||||
/// Create render target views
|
||||
fn create_rt_views(
|
||||
device: &wgpu::Device,
|
||||
|
Loading…
Reference in New Issue
Block a user