Skip to content

Commit

Permalink
drop clear_views in surface_texture_discard
Browse files Browse the repository at this point in the history
Fixes #4056
  • Loading branch information
rajveermalviya committed Aug 15, 2023
1 parent 50cfc54 commit 2f04aee
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions wgpu-core/src/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,24 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {

// The texture ID got added to the device tracker by `submit()`,
// and now we are moving it away.
log::debug!(
"Removing swapchain texture {:?} from the device tracker",
texture_id.value
);
device.trackers.lock().textures.remove(texture_id.value);

let (texture, _) = hub.textures.unregister(texture_id.value.0, &mut token);
if let Some(texture) = texture {
if let resource::TextureClearMode::RenderPass { clear_views, .. } =
texture.clear_mode
{
for clear_view in clear_views {
unsafe {
hal::Device::destroy_texture_view(&device.raw, clear_view);
}
}
}

let suf = A::get_surface_mut(surface);
match texture.inner {
resource::TextureInner::Surface {
Expand Down

0 comments on commit 2f04aee

Please sign in to comment.