mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
clear incompatible shaders at config_load
This commit is contained in:
parent
2835a2292c
commit
0d5af3be36
@ -1627,6 +1627,28 @@ static void config_read_keybinds_conf(config_file_t *conf)
|
|||||||
read_keybinds_user(conf, i);
|
read_keybinds_user(conf, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool check_shader_compatibility(enum file_path_enum enum_idx)
|
||||||
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
if (string_is_equal("vulkan", settings->video.driver))
|
||||||
|
{
|
||||||
|
if (enum_idx != FILE_PATH_SLANGP_EXTENSION)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string_is_equal("gl", settings->video.driver) ||
|
||||||
|
string_is_equal("d3d9", settings->video.driver))
|
||||||
|
{
|
||||||
|
if (enum_idx == FILE_PATH_SLANGP_EXTENSION)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static bool config_read_keybinds(const char *path)
|
static bool config_read_keybinds(const char *path)
|
||||||
{
|
{
|
||||||
@ -2150,6 +2172,19 @@ static bool config_load_file(const char *path, bool set_defaults,
|
|||||||
config_read_keybinds_conf(conf);
|
config_read_keybinds_conf(conf);
|
||||||
|
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
|
for(i = FILE_PATH_CGP_EXTENSION; i <= FILE_PATH_SLANGP_EXTENSION; i++)
|
||||||
|
{
|
||||||
|
if(strstr(file_path_str((enum file_path_enum)(i)), path_get_extension(settings->path.shader)))
|
||||||
|
{
|
||||||
|
if (!check_shader_compatibility(i))
|
||||||
|
{
|
||||||
|
RARCH_LOG("Incompatible shader for backend %s, clearing...\n", settings->video.driver);
|
||||||
|
settings->path.shader[0] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (conf)
|
if (conf)
|
||||||
@ -2434,28 +2469,6 @@ bool config_load_remap(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool check_shader_compatibility(enum file_path_enum enum_idx)
|
|
||||||
{
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
if (string_is_equal("vulkan", settings->video.driver))
|
|
||||||
{
|
|
||||||
if (enum_idx != FILE_PATH_SLANGP_EXTENSION)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string_is_equal("gl", settings->video.driver) ||
|
|
||||||
string_is_equal("d3d9", settings->video.driver))
|
|
||||||
{
|
|
||||||
if (enum_idx == FILE_PATH_SLANGP_EXTENSION)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* config_load_shader_preset:
|
* config_load_shader_preset:
|
||||||
*
|
*
|
||||||
@ -2502,7 +2515,7 @@ bool config_load_shader_preset(void)
|
|||||||
|
|
||||||
RARCH_LOG("Shaders: preset directory: %s\n", shader_directory);
|
RARCH_LOG("Shaders: preset directory: %s\n", shader_directory);
|
||||||
|
|
||||||
for(idx = FILE_PATH_CGP_EXTENSION; idx < FILE_PATH_SLANGP_EXTENSION; idx++)
|
for(idx = FILE_PATH_CGP_EXTENSION; idx <= FILE_PATH_SLANGP_EXTENSION; idx++)
|
||||||
{
|
{
|
||||||
config_file_t *new_conf = NULL;
|
config_file_t *new_conf = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user