Skip to content

Validation Error caused by handling of suboptimal surface texture #668

@me-self

Description

@me-self

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions