Skip to content

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

@simast

Description

@simast

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions