Skip to content

Compatibility issues with Linux/Wayland #43

Description

@zeux

I've tried to run some NV samples that use this framework and hit a couple of issues on Linux/Wayland/NV driver combination; they prevent the code from running correctly, but require fairly minimal fixes.

  1. The window never shows up in Wayland; the issue is that in Wayland, for the window to appear you need to render to it; glfwShowWindow doesn't do anything (https://github.com/glfw/glfw/blob/master/src/wl_window.c#L2603). As a result, the window does not become focused; UpdateWindowSize() sets focused to false before the loop gets a chance to run once, and the render loop checks the focus flag before rendering. This can be fixed by changing the focused state inside glfw FocusCallback (which then means it's initialized to true and stays true) - I'm not sure if this is fully robust and if this works on other platforms.

  2. surfaceCaps.currentExtent.width can't be used unconditionally; it's valid for the width/height to be UINT_MAX which means you should get the size from the window system. The code right now tries to allocate UINT_MAXxUINT_MAX swapchain which predictably fails.

  3. Recreation of the swapchain during window resizes can succeed with SUBOPTIMAL_KHR; the code treats it as a failure and crashes. This can happen due to a natural desync during window resize; it's intermittent, but it usually happens for me when I resize the window a number of times.

All of these are likely to be specific to the precise combination above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions