diff options
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r-- | src/egl/main/eglapi.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 000368a46a1..c5e3955c48c 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -1201,7 +1201,17 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval) if (_eglGetSurfaceHandle(surf) == EGL_NO_SURFACE) RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); - ret = drv->API.SwapInterval(drv, disp, surf, interval); + interval = CLAMP(interval, + surf->Config->MinSwapInterval, + surf->Config->MaxSwapInterval); + + if (surf->SwapInterval != interval) + ret = drv->API.SwapInterval(drv, disp, surf, interval); + else + ret = EGL_TRUE; + + if (ret) + surf->SwapInterval = interval; RETURN_EGL_EVAL(disp, ret); } |