Only show black frame insertion for the video drivers/context drivers

that support it
This commit is contained in:
twinaphex 2018-04-23 14:15:21 +02:00
parent ee621ba476
commit e54cb1b121
6 changed files with 59 additions and 19 deletions

View File

@ -1860,8 +1860,17 @@ static void d3d8_set_video_mode(void *data,
#endif
}
static uint32_t d3d8_get_flags(void *data)
{
uint32_t flags = 0;
BIT32_SET(flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION);
return flags;
}
static const video_poke_interface_t d3d_poke_interface = {
NULL, /* get_flags */
d3d8_get_flags,
NULL, /* set_coords */
d3d8_set_mvp,
d3d8_load_texture,

View File

@ -1886,8 +1886,17 @@ static void d3d9_set_video_mode(void *data,
#endif
}
static uint32_t d3d9_get_flags(void *data)
{
uint32_t flags = 0;
BIT32_SET(flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION);
return flags;
}
static const video_poke_interface_t d3d9_poke_interface = {
NULL, /* get_flags */
d3d9_get_flags,
NULL, /* set_coords */
d3d9_set_mvp,
d3d9_load_texture,

View File

@ -2607,6 +2607,8 @@ static uint32_t gl_get_flags(void *data)
if (gl_check_capability(GL_CAPS_SYNC))
BIT32_SET(flags, GFX_CTX_FLAGS_HARD_SYNC);
BIT32_SET(flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION);
return flags;
}

View File

@ -2307,6 +2307,7 @@ static uint32_t vulkan_get_flags(void *data)
uint32_t flags = 0;
BIT32_SET(flags, GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES);
BIT32_SET(flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION);
return flags;
}

View File

@ -114,7 +114,8 @@ enum display_flags
GFX_CTX_FLAGS_GL_CORE_CONTEXT,
GFX_CTX_FLAGS_MULTISAMPLING,
GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES,
GFX_CTX_FLAGS_HARD_SYNC
GFX_CTX_FLAGS_HARD_SYNC,
GFX_CTX_FLAGS_BLACK_FRAME_INSERTION
};
enum shader_uniform_type

View File

@ -3673,22 +3673,40 @@ static bool setting_append_list(
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
#if !defined(RARCH_MOBILE)
CONFIG_BOOL(
list, list_info,
&settings->bools.video_black_frame_insertion,
MENU_ENUM_LABEL_VIDEO_BLACK_FRAME_INSERTION,
MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION,
black_frame_insertion,
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
);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
{
gfx_ctx_flags_t flags;
bool black_frame_insertion_supported = false;
if (video_driver_get_flags(&flags))
if (BIT32_GET(flags.flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION))
black_frame_insertion_supported = true;
flags.flags = 0;
if (video_context_driver_get_flags(&flags))
if (BIT32_GET(flags.flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION))
black_frame_insertion_supported = true;
if (black_frame_insertion_supported)
{
CONFIG_BOOL(
list, list_info,
&settings->bools.video_black_frame_insertion,
MENU_ENUM_LABEL_VIDEO_BLACK_FRAME_INSERTION,
MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION,
black_frame_insertion,
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
);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
}
}
#endif
END_SUB_GROUP(list, list_info, parent_group);
START_SUB_GROUP(