gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
11.46k stars 855 forks source link

Clean refs to died texture views #5874

Closed xiaopengli89 closed 3 days ago

xiaopengli89 commented 4 days ago

Connections Close #5707

Description

Checklist

xiaopengli89 commented 3 days ago

Nice catch!

Most of the code in life.rs is quite tricky to understand and will hopefully go away in a not-so-distant future. I think that this fix would be easier to understand (and less likely to get accidentally removed along with the resource triaging code) if done just before inserting a view in Texture::views in Global::texture_create_view.

And while you are at it, could you also clean up Texture::bind_groups and Buffer::bind_groups the same way in Global::create_bind_group?

Done.

nical commented 3 days ago

Thanks!