OpenGL implementation reports Vsync enabled, appears to be not entirely true

Discussion in 'Windows Virtual Machine' started by TimK13, Mar 9, 2024.

  1. TimK13

    TimK13 Member

    I've found that my OpenGL applications running under Windows 11 ARM on a Parallels VM appear to misprepresent the current state of eglSwapInterval

    According to the OpenGL specification, the default swap interval should default to 1
    At first, that would seem to be the case (wglGetSwapIntervalEXT() reports 1 on application startup) however it's quite clear that Vsync is not in effect (with the application generating frames as quickly as possible).

    I've modified my code to explicitly set the swap interval regardless of what is reported by wglGetSwapInterval(), however this seems like a Parallels driver bug. Vsync should be enabled by default and wglGetSwapIntervalEXT() should reflect the true swap interval

    int targetSwapInterval = 1;
    int initialSwapInterval = wglGetSwapIntervalEXT();
    printf("Initial swap interval == %d", initialSwapInterval);

    // NOTE: wglGetSwapInterval lies
    // We've seen this to be the case with Parallels running Windows on ARM
    // Even when the swap interval is reported as 1 (vsync) we still need to explicitly set it, or we
    // find that vsync is _not_ in fact enabled.
    // The below condition commented out accordingly

    //if (initialSwapInterval != targetSwapInterval)
    printf("Setting swap interval to requested value %d", targetSwapInterval);
    if (!wglSwapIntervalEXT(targetSwapInterval))
    printf("Failed to set swap interval");

Share This Page