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

Texture needs to have the COPY_DST flag. Otherwise we can't ensure initialized memory! #2309

Closed
simast opened this issue Dec 20, 2021 · 2 comments

Comments

@simast
Copy link

simast commented Dec 20, 2021

Description
Texture creation fails with wgpu 0.12.

Repro steps

I have the following code which creates a frame texture that I then render the output to (for post processing):

let texture = device.create_texture(&TextureDescriptor {
    label: Some("Post-Processing Frame Texture"),
    size: Extent3d {
        width: surface_config.width,
        height: surface_config.height,
        depth_or_array_layers: 1,
    },
    mip_level_count: 1,
    sample_count: 1,
    dimension: TextureDimension::D2,
    format: surface_config.format,
    usage: TextureUsages::TEXTURE_BINDING
        | TextureUsages::COPY_DST // Added as part of wgpu 0.12 migration
        | TextureUsages::RENDER_ATTACHMENT,
});

However, since wgpu 0.12 update this is always hitting a debug assertion on the following line:

debug_assert!(texture.hal_usage.contains(hal::TextureUses::COPY_DST),
"Texture needs to have the COPY_DST flag. Otherwise we can't ensure initialized memory!");

Expected vs observed behavior
Texture creation works as expected.

Platform
Windows 11, Vulcan backend, wgpu 0.12.

@kvark
Copy link
Member

kvark commented Dec 20, 2021

Thank you for filing!
This is being addressed in #2307

@niklaskorz
Copy link
Contributor

Fixed by #2307 :) can confirm it works now on https://github.com/niklaskorz/linon/tree/wgpu-0.12

@kvark kvark closed this as completed Dec 29, 2021
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

No branches or pull requests

3 participants