Skip to content

Can't wgpuTextureRelease() the wgpuSurfaceGetCurrentTexture() according to the docs #514

@yig

Description

@yig

The documentation on ownership states that users must call wgpuTextureRelease(surfaceTexture.texture), where surfaceTexture is the WGPUSurfaceTexture filled by wgpuSurfaceGetCurrentTexture(). The documentation on surfaces states that it can be called before wgpuSurfacePresent() (but presumably after calling wgpuTextureCreateView(), which increments the reference count). However, this breaks wgpu-native v24.0.3.1. It crashes or gives me blank surface, depending on when I release it. Dawn allows me to release it as soon as I create the texture view. If I release it as soon as I create the texture view, I get the following panic:

thread '<unnamed>' panicked at src/lib.rs:598:5:
Error in wgpuQueueSubmit: Validation Error

Caused by:
  Texture with '<Surface Texture>' label has been destroyed

If I release it immediately before calling wgpuSurfacePresent(), I get a blank surface.

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