st/wgl: check if WGL_SWAP_INTERVAL is defined in wglSwapIntervalEXT()

This allows the WGL_SWAP_INTERVAL env var to override any application
calls to wglSwapIntervalEXT().  Useful for debugging, or to set the
interval to zero to effectively disable the swap interval.

Note: we also rename the previous instance of SVGA_SWAP_INTERVAL to
WGL_SWAP_INTERVAL since this is a WGL feature and not related to the
svga driver.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
This commit is contained in:
Brian Paul 2018-03-30 14:44:50 -06:00
parent 1bf201ddce
commit c8906b8459
2 changed files with 2 additions and 2 deletions

View file

@ -135,7 +135,7 @@ stw_init(const struct stw_winsys *stw_winsys)
stw_pixelformat_init();
/* env var override for WGL_EXT_swap_control, useful for testing/debugging */
const char *s = os_get_option("SVGA_SWAP_INTERVAL");
const char *s = os_get_option("WGL_SWAP_INTERVAL");
if (s) {
stw_dev->swap_interval = atoi(s);
}

View file

@ -48,7 +48,7 @@ wglSwapIntervalEXT(int interval)
SetLastError(ERROR_INVALID_DATA);
return FALSE;
}
if (stw_dev) {
if (stw_dev && !os_get_option("WGL_SWAP_INTERVAL")) {
stw_dev->swap_interval = interval;
}
return TRUE;