mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
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:
9
glfw/context.c
vendored
9
glfw/context.c
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user