Calling configure on the surface while the surface texture is still around is causing a validation error.
wgpu::CurrentSurfaceTexture::Suboptimal(surface_texture) => {
self.surface.configure(&self.device, &self.config);
surface_texture
}
wgpu error: Validation Error
Caused by:
In Surface::configure
`SurfaceOutput` must be dropped before a new `Surface` is made
I'm not familiar enough with wgpu to know whether this is good practice or not, but dropping it and just calling render again seems to do the trick:
wgpu::CurrentSurfaceTexture::Suboptimal(surface_texture) => {
drop(surface_texture);
self.surface.configure(&self.device, &self.config);
return self.render();
}
Calling
configureon the surface while the surface texture is still around is causing a validation error.I'm not familiar enough with wgpu to know whether this is good practice or not, but dropping it and just calling
renderagain seems to do the trick: