From f5d40080189103e97b36a7d7febaf6a5ec584f4a Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 4 May 2013 22:48:24 +0200 Subject: [PATCH] Check g_settings.video.hard_sync per frame. Don't use hard_sync default in RGUI. --- frontend/menu/rgui.c | 6 +++--- gfx/gl.c | 6 +++--- gfx/gl_common.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index b23ef938ee..e9a9413a8e 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -1289,8 +1289,8 @@ static void rgui_settings_shader_manager_populate_entries(rgui_handle_t *rgui) rgui_list_push(rgui->selection_buf, "Toggle Fullscreen", RGUI_SETTINGS_TOGGLE_FULLSCREEN, 0); #endif rgui_list_push(rgui->selection_buf, "Rotation", RGUI_SETTINGS_VIDEO_ROTATION, 0); - rgui_list_push(rgui->selection_buf, "Vertical sync", RGUI_SETTINGS_VIDEO_VSYNC, 0); - rgui_list_push(rgui->selection_buf, "Hard sync", RGUI_SETTINGS_VIDEO_HARD_SYNC, 0); + rgui_list_push(rgui->selection_buf, "VSync", RGUI_SETTINGS_VIDEO_VSYNC, 0); + rgui_list_push(rgui->selection_buf, "Hard VSync", RGUI_SETTINGS_VIDEO_HARD_SYNC, 0); #ifdef HAVE_SHADER_MANAGER rgui_list_push(rgui->selection_buf, "Apply Shader Changes", RGUI_SETTINGS_SHADER_APPLY, 0); @@ -1522,7 +1522,7 @@ static int shader_manager_toggle_setting(rgui_handle_t *rgui, unsigned setting, switch (action) { case RGUI_ACTION_START: - g_settings.video.hard_sync = true; + g_settings.video.hard_sync = false; break; case RGUI_ACTION_LEFT: diff --git a/gfx/gl.c b/gfx/gl.c index 2cfefb0ead..771fb0956d 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1467,7 +1467,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei g_extern.frame_count++; #ifdef HAVE_GL_SYNC - if (gl->use_sync) + if (g_settings.video.hard_sync && gl->have_sync) { RARCH_PERFORMANCE_INIT(gl_fence); RARCH_PERFORMANCE_START(gl_fence); @@ -1570,8 +1570,8 @@ static bool resolve_extensions(gl_t *gl) #endif #ifdef HAVE_GL_SYNC - gl->use_sync = g_settings.video.hard_sync && load_sync_proc(gl); - if (gl->use_sync) + gl->have_sync = load_sync_proc(gl); + if (gl->have_sync && g_settings.video.hard_sync) RARCH_LOG("[GL]: Using ARB_sync to reduce latency.\n"); #endif diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 01e5bb9440..2f2b395945 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -283,7 +283,7 @@ typedef struct gl #endif #ifdef HAVE_GL_SYNC - bool use_sync; + bool have_sync; #endif } gl_t;