mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 00:39:53 +00:00
(WGL) Adaptive Vsync should work now for WGL
This commit is contained in:
parent
98b20d4e5d
commit
914df58d2e
@ -1306,6 +1306,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("video_fullscreen", &settings->bools.video_fullscreen, true, fullscreen, false);
|
||||
SETTING_BOOL("bundle_assets_extract_enable", &settings->bools.bundle_assets_extract_enable, true, bundle_assets_extract_enable, false);
|
||||
SETTING_BOOL("video_vsync", &settings->bools.video_vsync, true, vsync, false);
|
||||
SETTING_BOOL("video_adaptive_vsync", &settings->bools.video_adaptive_vsync, true, false, false);
|
||||
SETTING_BOOL("video_hard_sync", &settings->bools.video_hard_sync, true, hard_sync, false);
|
||||
SETTING_BOOL("video_black_frame_insertion", &settings->bools.video_black_frame_insertion, true, black_frame_insertion, false);
|
||||
SETTING_BOOL("crt_switch_resolution", &settings->bools.crt_switch_resolution, true, crt_switch_resolution, false);
|
||||
|
@ -73,6 +73,7 @@ typedef struct settings
|
||||
bool video_fullscreen;
|
||||
bool video_windowed_fullscreen;
|
||||
bool video_vsync;
|
||||
bool video_adaptive_vsync;
|
||||
bool video_hard_sync;
|
||||
bool video_black_frame_insertion;
|
||||
bool video_vfilter;
|
||||
|
@ -91,6 +91,7 @@ static HGLRC win32_hw_hrc;
|
||||
static HDC win32_hdc;
|
||||
static bool win32_use_hw_ctx = false;
|
||||
static bool win32_core_hw_context_enable = false;
|
||||
static bool wgl_adaptive_vsync = false;
|
||||
|
||||
#ifdef HAVE_VULKAN
|
||||
static gfx_ctx_vulkan_data_t win32_vk;
|
||||
@ -105,9 +106,41 @@ static enum gfx_ctx_api win32_api = GFX_CTX_NONE;
|
||||
static dylib_t dll_handle = NULL; /* Handle to OpenGL32.dll */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
static bool wgl_has_extension(const char *extension, const char *extensions)
|
||||
{
|
||||
const char *start = NULL;
|
||||
const char *terminator = NULL;
|
||||
const char *where = strchr(extension, ' ');
|
||||
|
||||
if (where || *extension == '\0')
|
||||
return false;
|
||||
|
||||
if (!extensions)
|
||||
return false;
|
||||
|
||||
start = extensions;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
where = strstr(start, extension);
|
||||
if (!where)
|
||||
break;
|
||||
|
||||
terminator = where + strlen(extension);
|
||||
if (where == start || *(where - 1) == ' ')
|
||||
if (*terminator == ' ' || *terminator == '\0')
|
||||
return true;
|
||||
|
||||
start = terminator;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef struct gfx_ctx_cgl_data
|
||||
{
|
||||
bool adaptive_vsync;
|
||||
void *empty;
|
||||
} gfx_ctx_wgl_data_t;
|
||||
|
||||
static gfx_ctx_proc_t gfx_ctx_wgl_get_proc_address(const char *symbol)
|
||||
@ -264,6 +297,23 @@ static void create_gl_context(HWND hwnd, bool *quit)
|
||||
else
|
||||
RARCH_ERR("[WGL]: wglCreateContextAttribsARB not supported.\n");
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
const char *(WINAPI * wglGetExtensionsStringARB) (HDC) = 0;
|
||||
const char *extensions = NULL;
|
||||
|
||||
wglGetExtensionsStringARB = (const char *(WINAPI *) (HDC))
|
||||
gfx_ctx_wgl_get_proc_address("wglGetExtensionsStringARB");
|
||||
if (wglGetExtensionsStringARB)
|
||||
extensions = wglGetExtensionsStringARB(win32_hdc);
|
||||
RARCH_LOG("[WGL] extensions: %s\n", extensions);
|
||||
if (wgl_has_extension("WGL_EXT_swap_control_tear", extensions))
|
||||
{
|
||||
RARCH_LOG("[WGL]: Adaptive VSync supported.\n");
|
||||
wgl_adaptive_vsync = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -323,7 +373,7 @@ static void gfx_ctx_wgl_swap_interval(void *data, int interval)
|
||||
if (!p_swap_interval)
|
||||
return;
|
||||
|
||||
RARCH_LOG("[WGL]: wglSwapInterval(%u)\n", win32_interval);
|
||||
RARCH_LOG("[WGL]: wglSwapInterval(%i)\n", win32_interval);
|
||||
if (!p_swap_interval(win32_interval))
|
||||
RARCH_WARN("[WGL]: wglSwapInterval() failed.\n");
|
||||
#endif
|
||||
@ -479,6 +529,7 @@ static void *gfx_ctx_wgl_init(video_frame_info_t *video_info, void *video_driver
|
||||
#ifdef HAVE_DYNAMIC
|
||||
dll_handle = dylib_load("OpenGL32.dll");
|
||||
#endif
|
||||
|
||||
|
||||
win32_window_reset();
|
||||
win32_monitor_init();
|
||||
@ -573,6 +624,7 @@ static void gfx_ctx_wgl_destroy(void *data)
|
||||
if (wgl)
|
||||
free(wgl);
|
||||
|
||||
wgl_adaptive_vsync = false;
|
||||
win32_core_hw_context_enable = false;
|
||||
g_win32_inited = false;
|
||||
win32_major = 0;
|
||||
@ -727,21 +779,15 @@ static void *gfx_ctx_wgl_get_context_data(void *data)
|
||||
static uint32_t gfx_ctx_wgl_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
gfx_ctx_wgl_data_t *wgl = (gfx_ctx_wgl_data_t*)data;
|
||||
|
||||
(void)wgl;
|
||||
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_NONE);
|
||||
|
||||
switch (win32_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
if (wgl)
|
||||
if (wgl_adaptive_vsync)
|
||||
{
|
||||
if (wgl->adaptive_vsync)
|
||||
{
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC);
|
||||
}
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC);
|
||||
}
|
||||
|
||||
if (win32_core_hw_context_enable)
|
||||
@ -759,19 +805,13 @@ static uint32_t gfx_ctx_wgl_get_flags(void *data)
|
||||
|
||||
static void gfx_ctx_wgl_set_flags(void *data, uint32_t flags)
|
||||
{
|
||||
gfx_ctx_wgl_data_t *wgl = (gfx_ctx_wgl_data_t*)data;
|
||||
|
||||
(void)wgl;
|
||||
|
||||
switch (win32_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
#ifdef HAVE_OPENGL
|
||||
if (wgl)
|
||||
if (BIT32_GET(flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC))
|
||||
{
|
||||
if (BIT32_GET(flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC))
|
||||
if (gl_query_extension("WGL_EXT_swap_control_tear"))
|
||||
wgl->adaptive_vsync = true;
|
||||
wgl_adaptive_vsync = true;
|
||||
}
|
||||
|
||||
if (BIT32_GET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT))
|
||||
|
@ -1209,7 +1209,7 @@ static void gfx_ctx_x_set_flags(void *data, uint32_t flags)
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
if (BIT32_GET(flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC))
|
||||
if (gl_query_extension("GLX_EXT_swap_control_tear"))
|
||||
if (GLXExtensionSupported(g_x11_dpy, "GLX_EXT_swap_control_tear"))
|
||||
x->adaptive_vsync = true;
|
||||
if (BIT32_GET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT))
|
||||
x->core_hw_context_enable = true;
|
||||
|
@ -3204,9 +3204,14 @@ bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data)
|
||||
|
||||
bool video_context_driver_swap_interval(int *interval)
|
||||
{
|
||||
int current_interval = *interval;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool adaptive_vsync_enabled = settings->bools.video_adaptive_vsync;
|
||||
if (!current_video_context.swap_interval)
|
||||
return false;
|
||||
current_video_context.swap_interval(video_context_data, *interval);
|
||||
if (adaptive_vsync_enabled && current_interval == 1)
|
||||
current_interval = -1;
|
||||
current_video_context.swap_interval(video_context_data, current_interval);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -3541,3 +3541,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3325,3 +3325,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3317,3 +3317,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3427,3 +3427,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3192,3 +3192,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -7422,3 +7422,11 @@ MSG_HASH(
|
||||
MSG_FAILED_TO_SET_DISK,
|
||||
"Fallo al establecer disco"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3351,3 +3351,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3411,3 +3411,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Modalità delle Prestazioni Sostenute")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"supporto mpv ")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3812,3 +3812,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DOWNLOAD_PLAYLIST_THUMBNAIL_PROGRESS,
|
||||
"成功した数: %1 失敗した数: %2")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_OPTIONS,
|
||||
"コア設定")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3312,3 +3312,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -1257,6 +1257,8 @@ MSG_HASH(MENU_ENUM_LABEL_VIDEO_VI_WIDTH,
|
||||
"video_vi_width")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_VSYNC,
|
||||
"video_vsync")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"video_adaptive_vsync")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_WINDOWED_FULLSCREEN,
|
||||
"video_windowed_fullscreen")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_WINDOW_WIDTH,
|
||||
|
@ -3194,3 +3194,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3622,3 +3622,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Trwały tryb wydajności")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"Wsparcie dla MPV")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -7441,3 +7441,11 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE_OPTIONS,
|
||||
"Opções de Núcleo"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3286,3 +3286,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3482,3 +3482,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -7442,3 +7442,11 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE_OPTIONS,
|
||||
"Core Options"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -3349,3 +3349,11 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSTAINED_PERFORMANCE_MODE,
|
||||
"Sustained Performance Mode")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_MPV_SUPPORT,
|
||||
"mpv support")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
"Adaptive Vsync"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
"V-Sync is enabled until performance falls below the target refresh rate. Can minimize stuttering when performance falls below realtime, and can be more energy efficient."
|
||||
)
|
||||
|
@ -154,6 +154,7 @@ default_sublabel_macro(action_bind_sublabel_axis_threshold, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_input_turbo_period, MENU_ENUM_SUBLABEL_INPUT_TURBO_PERIOD)
|
||||
default_sublabel_macro(action_bind_sublabel_input_duty_cycle, MENU_ENUM_SUBLABEL_INPUT_DUTY_CYCLE)
|
||||
default_sublabel_macro(action_bind_sublabel_video_vertical_sync, MENU_ENUM_SUBLABEL_VIDEO_VSYNC)
|
||||
default_sublabel_macro(action_bind_sublabel_video_adaptive_vsync, MENU_ENUM_SUBLABEL_VIDEO_ADAPTIVE_VSYNC)
|
||||
default_sublabel_macro(action_bind_sublabel_core_allow_rotate, MENU_ENUM_SUBLABEL_VIDEO_ALLOW_ROTATE)
|
||||
default_sublabel_macro(action_bind_sublabel_dummy_on_core_shutdown, MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN)
|
||||
default_sublabel_macro(action_bind_sublabel_dummy_check_missing_firmware, MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE)
|
||||
@ -1625,6 +1626,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_VIDEO_VSYNC:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_vertical_sync);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_ADAPTIVE_VSYNC:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_adaptive_vsync);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_INPUT_DUTY_CYCLE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_duty_cycle);
|
||||
break;
|
||||
|
@ -6394,6 +6394,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_SWAP_INTERVAL,
|
||||
PARSE_ONLY_UINT, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
if (menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES,
|
||||
PARSE_ONLY_UINT, false) == 0)
|
||||
|
@ -4415,6 +4415,40 @@ static bool setting_append_list(
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
bool adaptive_vsync_supported = false;
|
||||
|
||||
if (video_driver_get_flags(&flags))
|
||||
if (BIT32_GET(flags.flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC))
|
||||
adaptive_vsync_supported = true;
|
||||
|
||||
flags.flags = 0;
|
||||
|
||||
if (video_context_driver_get_flags(&flags))
|
||||
if (BIT32_GET(flags.flags, GFX_CTX_FLAGS_ADAPTIVE_VSYNC))
|
||||
adaptive_vsync_supported = true;
|
||||
|
||||
if (adaptive_vsync_supported)
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.video_adaptive_vsync,
|
||||
MENU_ENUM_LABEL_VIDEO_ADAPTIVE_VSYNC,
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_ADAPTIVE_VSYNC,
|
||||
false,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
&settings->uints.video_frame_delay,
|
||||
|
@ -715,6 +715,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(VIDEO_BLACK_FRAME_INSERTION),
|
||||
MENU_LABEL(VIDEO_FRAME_DELAY),
|
||||
MENU_LABEL(VIDEO_VSYNC),
|
||||
MENU_LABEL(VIDEO_ADAPTIVE_VSYNC),
|
||||
MENU_LABEL(VIDEO_HARD_SYNC),
|
||||
MENU_LABEL(VIDEO_HARD_SYNC_FRAMES),
|
||||
MENU_LABEL(VIDEO_WINDOWED_FULLSCREEN),
|
||||
|
Loading…
x
Reference in New Issue
Block a user