From 00590f20771b11c1bff97c39f7b8e6fb89176cef Mon Sep 17 00:00:00 2001 From: natinusala Date: Fri, 20 Mar 2020 09:19:06 +0100 Subject: [PATCH] Fix VG and VC EGL --- gfx/drivers/vg.c | 10 +++++----- gfx/drivers_context/vc_egl_ctx.c | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index 4f08667beb..c452ee433f 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -127,6 +127,8 @@ static void *vg_init(const video_info_t *video, const gfx_ctx_driver_t *ctx = video_context_driver_init_first( vg, settings->arrays.video_context_driver, GFX_CTX_OPENVG_API, 0, 0, false, &ctx_data); + bool adaptive_vsync_enabled = video_driver_test_all_flags( + GFX_CTX_FLAGS_ADAPTIVE_VSYNC) && video->adaptive_vsync; if (!vg || !ctx) goto error; @@ -153,8 +155,6 @@ static void *vg_init(const video_info_t *video, if (ctx->swap_interval) { - bool adaptive_vsync_enabled = video_driver_test_all_flags( - GFX_CTX_FLAGS_ADAPTIVE_VSYNC) && video->adaptive_vsync; if (adaptive_vsync_enabled && interval == 1) interval = -1; ctx->swap_interval(vg->ctx_data, interval); @@ -221,10 +221,10 @@ static void *vg_init(const video_info_t *video, vg->mTexType, vg->mTextureWidth, vg->mTextureHeight, - video->smooth - ? VG_IMAGE_QUALITY_BETTER + video->smooth + ? VG_IMAGE_QUALITY_BETTER : VG_IMAGE_QUALITY_NONANTIALIASED); - vg_set_nonblock_state(vg, !video->vsync); + vg_set_nonblock_state(vg, !video->vsync, adaptive_vsync_enabled, interval); inp.input = input; inp.input_data = input_data; diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index 2222ffb6ce..9eceb5da57 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -180,7 +180,6 @@ static void *gfx_ctx_vc_init(void *video_driver) EGL_NONE }; #endif - settings_t *settings = config_get_ptr(); vc_ctx_data_t *vc = NULL; unsigned fullscreen_x = settings->uints.video_fullscreen_x; unsigned fullscreen_y = settings->uints.video_fullscreen_y;