diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 6dea41747b..7b2c063f26 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -1320,7 +1320,7 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) snprintf(s, len, "Use threaded video driver.\n" " \n" - "Using this might improve performance at \n" + "Using this might improve performance at the \n" "possible cost of latency and more video \n" "stuttering."); break; @@ -1899,6 +1899,10 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg) switch (msg) { + case MENU_ENUM_SUBLABEL_VIDEO_THREADED: + return "Improves performance at the cost of latency and more video stuttering. Use only if you cannot obtain full speed otherwise."; + case MENU_ENUM_SUBLABEL_VIDEO_HARD_SYNC: + return "Hard-synchronize the CPU and GPU. Reduces latency at the cost of performance."; case MENU_ENUM_SUBLABEL_MENU_SETTINGS: return "Adjusts settings related to the appearance of the menu screen."; case MSG_CONNECTION_SLOT: diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 3f5a5e41e8..f8c7725c87 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -230,6 +230,16 @@ static int action_bind_sublabel_video_refresh_rate_auto( return 0; } +static int action_bind_sublabel_video_hard_sync( + file_list_t *list, + unsigned type, unsigned i, + const char *label, const char *path, + char *s, size_t len) +{ + strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_HARD_SYNC), len); + return 0; +} + static int action_bind_sublabel_video_hard_sync_frames( file_list_t *list, unsigned type, unsigned i, @@ -240,6 +250,16 @@ static int action_bind_sublabel_video_hard_sync_frames( return 0; } +static int action_bind_sublabel_video_threaded( + file_list_t *list, + unsigned type, unsigned i, + const char *label, const char *path, + char *s, size_t len) +{ + strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_VIDEO_THREADED), len); + return 0; +} + int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx) { @@ -252,6 +272,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, { switch (cbs->enum_idx) { + case MENU_ENUM_LABEL_VIDEO_THREADED: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_threaded); + break; + case MENU_ENUM_LABEL_VIDEO_HARD_SYNC: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_hard_sync); + break; case MENU_ENUM_LABEL_VIDEO_HARD_SYNC_FRAMES: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_hard_sync_frames); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b5dc99fb92..e52b8df049 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5138,10 +5138,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_VIDEO_VSYNC, PARSE_ONLY_BOOL, false); menu_displaylist_parse_settings_enum(menu, info, - MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES, + MENU_ENUM_LABEL_VIDEO_SWAP_INTERVAL, PARSE_ONLY_UINT, false); menu_displaylist_parse_settings_enum(menu, info, - MENU_ENUM_LABEL_VIDEO_SWAP_INTERVAL, + MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES, PARSE_ONLY_UINT, false); menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_VIDEO_HARD_SYNC, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 06789bceb2..7e6c781b0e 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -3583,21 +3583,6 @@ static bool setting_append_list( ); menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_VIDEO_VSYNC); - CONFIG_UINT( - list, list_info, - &settings->video.max_swapchain_images, - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES), - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_MAX_SWAPCHAIN_IMAGES), - max_swapchain_images, - &group_info, - &subgroup_info, - parent_group, - general_write_handler, - general_read_handler); - menu_settings_list_current_add_range(list, list_info, 1, 4, 1, true, true); - settings_data_list_current_add_flags(list, list_info, SD_FLAG_CMD_APPLY_AUTO|SD_FLAG_ADVANCED); - menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES); - CONFIG_UINT( list, list_info, &settings->video.swap_interval, @@ -3614,6 +3599,21 @@ static bool setting_append_list( settings_data_list_current_add_flags(list, list_info, SD_FLAG_CMD_APPLY_AUTO|SD_FLAG_ADVANCED); menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_VIDEO_SWAP_INTERVAL); + CONFIG_UINT( + list, list_info, + &settings->video.max_swapchain_images, + msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES), + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_MAX_SWAPCHAIN_IMAGES), + max_swapchain_images, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + menu_settings_list_current_add_range(list, list_info, 1, 4, 1, true, true); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_CMD_APPLY_AUTO|SD_FLAG_ADVANCED); + menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES); + if (string_is_equal(settings->video.driver, "gl")) { CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index 6b4e88a4cf..5bf629a2b2 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1876,7 +1876,9 @@ enum msg_hash_enums MENU_ENUM_SUBLABEL_VIDEO_MAX_SWAPCHAIN_IMAGES, MENU_ENUM_SUBLABEL_ONLINE_UPDATER, MENU_ENUM_SUBLABEL_NETPLAY, - MENU_ENUM_SUBLABEL_MENU_SETTINGS + MENU_ENUM_SUBLABEL_MENU_SETTINGS, + MENU_ENUM_SUBLABEL_VIDEO_HARD_SYNC, + MENU_ENUM_SUBLABEL_VIDEO_THREADED };