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.
-
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.
-
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.
-
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.
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.
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.
surfaceCaps.currentExtent.widthcan't be used unconditionally; it's valid for the width/height to beUINT_MAXwhich means you should get the size from the window system. The code right now tries to allocateUINT_MAXxUINT_MAXswapchain which predictably fails.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.