Skip to content

How to handle window resizing on macOS #249

@DagAgren

Description

@DagAgren

I am playing around with using wgpu in a macOS project (and eventually iOS, but haven't tried it yet).

Right now I am struggling with how to handle window resizing. I'm currently rendering using CVDisplayLink, and for each frame checking if the size of the window has changed since last frame, and if so, I create a new swap chain.

This is causing double buffer flickering when resizing the window - every other frame is a frozen frame from the double buffer, and ever other is live updating and correct.

If I do not recreate the swap chain at all, it actually looks slightly better: Rendering seems to block completely for short times while resizing, and the contents of the previous frame is just resized instead.

Any clues what is going on? Am I doing something wrong, or is wgpu?

(Also, if I fullscreen, my framerate drops through the floor, and I get occasional squares of corruption on individual frames, but is that the same issue as #78 ?)

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