Move cli_shader to video_state (#13168)

* Move cli_shader to video_state

* Formatting fixes
This commit is contained in:
Autechre 2021-10-29 15:35:43 +02:00 committed by GitHub
parent ec7b7821fa
commit e42f8228de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 19 deletions

View File

@ -892,11 +892,12 @@ typedef struct
*/
gfx_ctx_flags_t deferred_flag_data; /* uint32_t alignment */
char cached_driver_id[32];
char title_buf[64];
char cli_shader_path[PATH_MAX_LENGTH];
char window_title[512];
char gpu_device_string[128];
char gpu_api_version_string[128];
char window_title[512];
char title_buf[64];
char cached_driver_id[32];
/**
* dynamic.c:dynamic_request_hw_context will try to set

View File

@ -16660,6 +16660,7 @@ static bool retroarch_parse_input_and_config(
bool cli_active = false;
bool cli_core_set = false;
bool cli_content_set = false;
video_driver_state_t *video_st = video_state_get_ptr();
runloop_state_t *runloop_st = &runloop_state;
settings_t *settings = config_get_ptr();
@ -16974,7 +16975,7 @@ static bool retroarch_parse_input_and_config(
break;
case 'f':
video_state_get_ptr()->force_fullscreen = true;
video_st->force_fullscreen = true;
break;
case 'N':
@ -17008,20 +17009,18 @@ static bool retroarch_parse_input_and_config(
/* disable auto-shaders */
if (string_is_empty(optarg))
{
video_state_get_ptr()->cli_shader_disable = true;
video_st->cli_shader_disable = true;
break;
}
/* rebase on shader directory */
if (!path_is_absolute(optarg))
{
char *ref_path = settings->paths.directory_video_shader;
fill_pathname_join(p_rarch->cli_shader,
ref_path, optarg, sizeof(p_rarch->cli_shader));
break;
}
strlcpy(p_rarch->cli_shader, optarg, sizeof(p_rarch->cli_shader));
if (path_is_absolute(optarg))
strlcpy(video_st->cli_shader_path, optarg,
sizeof(video_st->cli_shader_path));
else
fill_pathname_join(video_st->cli_shader_path,
settings->paths.directory_video_shader,
optarg, sizeof(video_st->cli_shader_path));
#endif
break;
@ -18123,9 +18122,11 @@ const char *retroarch_get_shader_preset(void)
if (video_st->shader_presets_need_reload && !cli_shader_disable)
{
video_st->shader_presets_need_reload = false;
if (video_shader_is_supported(video_shader_parse_type(p_rarch->cli_shader)))
if (video_shader_is_supported(
video_shader_parse_type(video_st->cli_shader_path)))
strlcpy(runloop_st->runtime_shader_preset_path,
p_rarch->cli_shader,
video_st->cli_shader_path,
sizeof(runloop_st->runtime_shader_preset_path));
else
{

View File

@ -601,9 +601,6 @@ struct rarch_state
char server_address_deferred[512];
#endif
char launch_arguments[4096];
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
char cli_shader[PATH_MAX_LENGTH];
#endif
char path_default_shader_preset[PATH_MAX_LENGTH];
char path_content[PATH_MAX_LENGTH];
char path_libretro[PATH_MAX_LENGTH];