On Sun Jan 5 21:49:36 2025 +0000, Elizabeth Figura wrote:
Maybe I should split that in two, one for ensuring XFlush(
gdi_display) for both wglFinish and wglFlush, and another for forcing glFinish when offscreen blit is used in glFlush? That would probably help.
glFinish() should only be called from wglFlush() if we need to blit
from offscreen drawable, and all the logic which detects / processes that is now inside present_gl_drawable(). Sorry, I don't understand? You're passing a flag to present_gl_drawable() to signal whether glFinish() should be called, so the logic is pretty clearly outside present_gl_drawable(). And as far as I can tell, the sequence isn't important; present_gl_drawable() doesn't do any GL work before glFinish() is called.
Well, the sequence is important: glFinish() should be called before NtGdiStretchBlt() in present_gl_drawable (so the GL really completes its part before we are trying to blit from its result). At the same time, calling before present_gl_drawable would inject unneeded and performance impacting glFinish on the normal path without offscreen blit.