Avoid an extra buffer swap during startup

glfw should not be swapping buffers behind the clients back. Since we
control the client, we can ensure that the OpenGL VRAM is cleared before
the window is shown.

Also fixes the issue with the glfw wayland backend where the buffer was
being created before the surface was configured
This commit is contained in:
Kovid Goyal
2022-06-28 09:25:24 +05:30
parent 31f9978599
commit 72dfa74b3e
3 changed files with 19 additions and 31 deletions

9
glfw/context.c vendored
View File

@@ -396,15 +396,6 @@ bool _glfwRefreshContextAttribs(_GLFWwindow* window,
window->context.release = GLFW_RELEASE_BEHAVIOR_FLUSH;
}
// Clearing the front buffer to black to avoid garbage pixels left over from
// previous uses of our bit of VRAM
{
PFNGLCLEARPROC glClear = (PFNGLCLEARPROC)
window->context.getProcAddress("glClear");
glClear(GL_COLOR_BUFFER_BIT);
window->context.swapBuffers(window);
}
glfwMakeContextCurrent((GLFWwindow*) previous);
return true;
}