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

IDs can be recycled before a resource is removed from the registry #5143

Closed
nical opened this issue Jan 26, 2024 · 1 comment
Closed

IDs can be recycled before a resource is removed from the registry #5143

nical opened this issue Jan 26, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@nical
Copy link
Contributor

nical commented Jan 26, 2024

Ids are made available for recycling from ResourceInfo::drop, or in other words, when a wgpu-core Texture, CommandBuffer, etc. is dropped.

It works fine in most cases because the registry holds arcs to the resources themselves. There is one case where it breaks: when we submit command buffers, they are replaced by placeholders in the registry that don't maintain the ResourceInfo alive. The ResourceInfo is then dropped before we get to remove the resource from the registry, allowing another CommandBuffer to be placed at the same index before we clear the slot of the previous one.

See also my ramblings in #5141

@nical nical added the type: bug Something isn't working label Jan 26, 2024
@teoxoy
Copy link
Member

teoxoy commented Jul 2, 2024

This was fixed by #5244.

@teoxoy teoxoy closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants