Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop texture clear_views in surface_texture_discard #4057

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

rajveermalviya
Copy link
Contributor

Fixes #4056

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
#4056

Description
The texture clear_views weren't destroyed in surface_texture_discard and that resulted in dangling VkImageViews.

Testing
Tested locally (on Linux) with repro mentioned in #4056

@rajveermalviya
Copy link
Contributor Author

This does fix the vulkan validation errors but still there is a weird behaviour, with the repro in #4056 if frame skip is triggered more than 3 times (not necessarily consecutive triggers): get_current_texture starts returning SurfaceError::Timeout unless the surface is reconfigured.

@cwfitzgerald
Copy link
Member

That's because discard isn't implemented:

unsafe fn discard_texture(&mut self, _texture: super::SurfaceTexture) {}

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Aug 15, 2023

More specifically, I'm not sure there's a meaningful way to implement discard at the hal level - we likely need to keep the image around at the core level and reuse it next time acquire is called.

@rajveermalviya
Copy link
Contributor Author

Hmm, in that case let's see how much I can grep.

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Aug 15, 2023

We can leave that to a follow up if that would be easier

wgpu-core/src/present.rs Outdated Show resolved Hide resolved
@rajveermalviya
Copy link
Contributor Author

We can leave that to a follow up if that would be easier

Yeah, lets do that

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice

@cwfitzgerald cwfitzgerald merged commit 625afc3 into gfx-rs:trunk Aug 30, 2023
bradwerth pushed a commit to bradwerth/wgpu that referenced this pull request Sep 19, 2023
@rajveermalviya rajveermalviya deleted the fix-4056 branch September 24, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skipping present() on SurfaceTexture results in VUID-vkDestroyDevice-device-00378
2 participants