Skip to content

Texture view leaks regression #6573

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

Closed
xiaopengli89 opened this issue Nov 20, 2024 · 3 comments · Fixed by #6576
Closed

Texture view leaks regression #6573

xiaopengli89 opened this issue Nov 20, 2024 · 3 comments · Fixed by #6576

Comments

@xiaopengli89
Copy link
Contributor

Description
Texture view leaks regression after 8ba5c82

Repro steps

let tex = dev.create_texture(&wgpu::TextureDescriptor {
    label: None,
    size: wgpu::Extent3d {
        width: 200,
        height: 200,
        depth_or_array_layers: 1,
    },
    mip_level_count: 1,
    sample_count: 1,
    dimension: wgpu::TextureDimension::D2,
    format: wgpu::TextureFormat::Rgba8Unorm,
    usage: wgpu::TextureUsages::TEXTURE_BINDING,
    view_formats: &[],
});

loop {
    let _view = tex.create_view(&Default::default());

    que.submit(None);
    dev.poll(wgpu::Maintain::Wait);
    std::thread::sleep(std::time::Duration::from_secs_f32(1. / 60.));
}

Extra materials
图片

@teoxoy
Copy link
Member

teoxoy commented Nov 20, 2024

I don't see how 8ba5c82 would have caused this, the new WeakVec stores only weak refs.

@xiaopengli89
Copy link
Contributor Author

I don't see how 8ba5c82 would have caused this, the new WeakVec stores only weak refs.

I think it is caused by the implementation of WeakVec, we should set scan_slots_on_next_push = true when empty_slots is empty:
图片

图片

@xiaopengli89 xiaopengli89 mentioned this issue Nov 21, 2024
7 tasks
@teoxoy
Copy link
Member

teoxoy commented Nov 21, 2024

Ah yes, that's a good point, empty_slots can be empty after we popped the last element.

@github-project-automation github-project-automation bot moved this from Todo to Done in WebGPU for Firefox Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants