Skip to content

hal/vulkan: generate separate hash identity for Texture/TextureViews #7972

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

Merged
merged 1 commit into from
Jul 21, 2025

Conversation

cwfitzgerald
Copy link
Member

Connections

Closes #7922
Closes #7956

Description

Previously we used the raw handle for equality/hash value for textures and texture views. This worked fine as long as the handles we are given are unique. However, if the implementation re-uses handles after we delete the views, as it has full right to do, we will use an old VkFramebuffer, causing a use-after-free.

Testing
Ran against renderdoc and against the reproduction provided in #7922.

Squash or Rebase?

Squabase

Going to add a changelog entry on backport,

@cwfitzgerald cwfitzgerald requested a review from a team as a code owner July 20, 2025 06:41
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label Jul 20, 2025
@cwfitzgerald cwfitzgerald force-pushed the cw/vulkan-view-identity branch from ee6b710 to 70edbfa Compare July 20, 2025 07:05
@cwfitzgerald cwfitzgerald force-pushed the cw/vulkan-view-identity branch from 70edbfa to 76eb7d7 Compare July 20, 2025 07:12
@Elabajaba
Copy link
Contributor

Tested and I can confirm that this fixes both #7922 and #7956.

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Good stuff!

@teoxoy
Copy link
Member

teoxoy commented Jul 21, 2025

For future reference, once we resolve #7847 and #7854 we can revert these changes.

@teoxoy teoxoy merged commit 9794870 into gfx-rs:trunk Jul 21, 2025
40 checks passed
@genusistimelord
Copy link
Contributor

yes this fixed those issue for me as well.

@cwfitzgerald cwfitzgerald deleted the cw/vulkan-view-identity branch July 21, 2025 13:05
@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Jul 23, 2025
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.

Renderdoc + vulkan is broken on wgpu 26. Vulkan Causing Flickering Rendering on AMD GPUs
4 participants