Skip to content

Commit beb8e53

Browse files
committed
apple: better metal arg buffer check
1 parent 2a8d0a7 commit beb8e53

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

config.def.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,12 +498,6 @@
498498
/* Choose if the screen will be able to write around the notch or not */
499499
#define DEFAULT_NOTCH_WRITE_OVER_ENABLE false
500500

501-
#if defined(__APPLE__) && defined(HAVE_VULKAN)
502-
#define DEFAULT_USE_METAL_ARG_BUFFERS (!!__builtin_available(macOS 12, iOS 13, tvOS 12, *))
503-
#else
504-
#define DEFAULT_USE_METAL_ARG_BUFFERS false
505-
#endif
506-
507501
/* Enable use of shaders */
508502
#define DEFAULT_SHADER_ENABLE true
509503

configuration.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,15 @@ static struct config_path_setting *populate_settings_path(
17671767
return tmp;
17681768
}
17691769

1770+
#if defined(__APPLE__) && defined(HAVE_VULKAN)
1771+
bool config_metal_arg_buffers_default(void)
1772+
{
1773+
if (__builtin_available(macOS 12.0, iOS 13.0, tvOS 12.0, *))
1774+
return true;
1775+
return false;
1776+
}
1777+
#endif
1778+
17701779
/* ---------------------------------------------------------------------------
17711780
* SETTINGS_*_COUNT_MAX constants are defined above the populate functions.
17721781
* Compile-time check (via negative array) can be added here if needed.
@@ -1968,7 +1977,7 @@ static struct config_bool_setting *populate_settings_bool(
19681977
SETTING_BOOL("video_post_filter_record", &settings->bools.video_post_filter_record, true, DEFAULT_POST_FILTER_RECORD, false);
19691978
SETTING_BOOL("video_notch_write_over_enable", &settings->bools.video_notch_write_over_enable, true, DEFAULT_NOTCH_WRITE_OVER_ENABLE, false);
19701979
#if defined(__APPLE__) && defined(HAVE_VULKAN)
1971-
SETTING_BOOL("video_use_metal_arg_buffers", &settings->bools.video_use_metal_arg_buffers, true, DEFAULT_USE_METAL_ARG_BUFFERS, false);
1980+
SETTING_BOOL("video_use_metal_arg_buffers", &settings->bools.video_use_metal_arg_buffers, true, config_metal_arg_buffers_default(), false);
19721981
#endif
19731982
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, DEFAULT_MESSAGE_BGCOLOR_ENABLE, false);
19741983
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, DEFAULT_WINDOW_DECORATIONS, false);

configuration.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,10 @@ bool config_replace(bool config_save_on_exit, char *path);
13961396

13971397
bool config_overlay_enable_default(void);
13981398

1399+
#if defined(__APPLE__) && defined(HAVE_VULKAN)
1400+
bool config_metal_arg_buffers_default(void);
1401+
#endif
1402+
13991403
void config_set_defaults(void *data);
14001404

14011405
void config_load(void *data);

menu/menu_setting.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13151,7 +13151,7 @@ static bool setting_append_list(
1315113151
&settings->bools.video_use_metal_arg_buffers,
1315213152
MENU_ENUM_LABEL_VIDEO_USE_METAL_ARG_BUFFERS,
1315313153
MENU_ENUM_LABEL_VALUE_VIDEO_USE_METAL_ARG_BUFFERS,
13154-
DEFAULT_USE_METAL_ARG_BUFFERS,
13154+
config_metal_arg_buffers_default(),
1315513155
MENU_ENUM_LABEL_VALUE_OFF,
1315613156
MENU_ENUM_LABEL_VALUE_ON,
1315713157
&group_info,

0 commit comments

Comments
 (0)