mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Rename read_conf_cgp/write_conf_cgp to
read_conf_preset/write_conf_preset
This commit is contained in:
parent
b38994461c
commit
f60306b232
@ -1142,13 +1142,16 @@ typedef struct MTLALIGN(16)
|
||||
|
||||
@try
|
||||
{
|
||||
if (!video_shader_read_conf_cgp(conf, shader))
|
||||
unsigned i;
|
||||
texture_t *source = NULL;
|
||||
if (!video_shader_read_conf_preset(conf, shader))
|
||||
return NO;
|
||||
|
||||
video_shader_resolve_relative(shader, path.UTF8String);
|
||||
|
||||
texture_t *source = &_engine.frame.texture[0];
|
||||
for (unsigned i = 0; i < shader->passes; source = &_engine.pass[i++].rt)
|
||||
source = &_engine.frame.texture[0];
|
||||
|
||||
for (i = 0; i < shader->passes; source = &_engine.pass[i++].rt)
|
||||
{
|
||||
matrix_float4x4 *mvp = (i == shader->passes-1) ? &_context.uniforms->projectionMatrix : &_engine.mvp;
|
||||
|
||||
@ -1321,7 +1324,7 @@ typedef struct MTLALIGN(16)
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < shader->luts; i++)
|
||||
for (i = 0; i < shader->luts; i++)
|
||||
{
|
||||
struct texture_image image = {0};
|
||||
image.supports_rgba = true;
|
||||
@ -1340,7 +1343,7 @@ typedef struct MTLALIGN(16)
|
||||
mipmapLevel:0 withBytes:image.pixels
|
||||
bytesPerRow:4 * image.width];
|
||||
|
||||
// TODO(sgc): generate mip maps
|
||||
/* TODO(sgc): generate mip maps */
|
||||
image_texture_free(&image);
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ static bool d3d10_gfx_set_shader(void* data,
|
||||
|
||||
d3d10->shader_preset = (struct video_shader*)calloc(1, sizeof(*d3d10->shader_preset));
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf, d3d10->shader_preset))
|
||||
if (!video_shader_read_conf_preset(conf, d3d10->shader_preset))
|
||||
goto error;
|
||||
|
||||
video_shader_resolve_relative(d3d10->shader_preset, path);
|
||||
|
@ -372,7 +372,7 @@ static bool d3d11_gfx_set_shader(void* data, enum rarch_shader_type type, const
|
||||
|
||||
d3d11->shader_preset = (struct video_shader*)calloc(1, sizeof(*d3d11->shader_preset));
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf, d3d11->shader_preset))
|
||||
if (!video_shader_read_conf_preset(conf, d3d11->shader_preset))
|
||||
goto error;
|
||||
|
||||
video_shader_resolve_relative(d3d11->shader_preset, path);
|
||||
|
@ -362,7 +362,7 @@ static bool d3d12_gfx_set_shader(void* data, enum rarch_shader_type type, const
|
||||
|
||||
d3d12->shader_preset = (struct video_shader*)calloc(1, sizeof(*d3d12->shader_preset));
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf, d3d12->shader_preset))
|
||||
if (!video_shader_read_conf_preset(conf, d3d12->shader_preset))
|
||||
goto error;
|
||||
|
||||
video_shader_resolve_relative(d3d12->shader_preset, path);
|
||||
|
@ -374,7 +374,7 @@ static bool d3d9_init_multipass(d3d9_video_t *d3d, const char *shader_path)
|
||||
|
||||
memset(&d3d->shader, 0, sizeof(d3d->shader));
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf, &d3d->shader))
|
||||
if (!video_shader_read_conf_preset(conf, &d3d->shader))
|
||||
{
|
||||
config_file_free(conf);
|
||||
RARCH_ERR("[D3D9]: Failed to parse CGP file.\n");
|
||||
|
@ -1449,7 +1449,7 @@ static bool wiiu_gfx_set_shader(void *data,
|
||||
|
||||
wiiu->shader_preset = calloc(1, sizeof(*wiiu->shader_preset));
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf, wiiu->shader_preset))
|
||||
if (!video_shader_read_conf_preset(conf, wiiu->shader_preset))
|
||||
{
|
||||
free(wiiu->shader_preset);
|
||||
wiiu->shader_preset = NULL;
|
||||
|
@ -787,7 +787,7 @@ static bool gl_cg_load_preset(void *data, const char *path)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf, cg->shader))
|
||||
if (!video_shader_read_conf_preset(conf, cg->shader))
|
||||
{
|
||||
RARCH_ERR("Failed to parse CGP file.\n");
|
||||
config_file_free(conf);
|
||||
|
@ -2388,7 +2388,7 @@ gl_core_filter_chain_t *gl_core_filter_chain_create_from_preset(
|
||||
if (!conf)
|
||||
return nullptr;
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf.get(), shader.get()))
|
||||
if (!video_shader_read_conf_preset(conf.get(), shader.get()))
|
||||
return nullptr;
|
||||
|
||||
video_shader_resolve_relative(shader.get(), path);
|
||||
|
@ -899,7 +899,7 @@ static void *gl_glsl_init(void *data, const char *path)
|
||||
conf = config_file_new(path);
|
||||
if (conf)
|
||||
{
|
||||
ret = video_shader_read_conf_cgp(conf, glsl->shader);
|
||||
ret = video_shader_read_conf_preset(conf, glsl->shader);
|
||||
glsl->shader->modern = true;
|
||||
}
|
||||
}
|
||||
|
@ -2890,7 +2890,7 @@ vulkan_filter_chain_t *vulkan_filter_chain_create_from_preset(
|
||||
if (!conf)
|
||||
return nullptr;
|
||||
|
||||
if (!video_shader_read_conf_cgp(conf.get(), shader.get()))
|
||||
if (!video_shader_read_conf_preset(conf.get(), shader.get()))
|
||||
return nullptr;
|
||||
|
||||
video_shader_resolve_relative(shader.get(), path);
|
||||
|
@ -708,7 +708,7 @@ error:
|
||||
}
|
||||
|
||||
/**
|
||||
* video_shader_read_conf_cgp:
|
||||
* video_shader_read_conf_preset:
|
||||
* @conf : Preset file to read from.
|
||||
* @shader : Shader passes handle.
|
||||
*
|
||||
@ -717,7 +717,7 @@ error:
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
bool video_shader_read_conf_preset(config_file_t *conf,
|
||||
struct video_shader *shader)
|
||||
{
|
||||
unsigned i;
|
||||
@ -725,6 +725,7 @@ bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
unsigned shaders = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *file_list = NULL;
|
||||
bool watch_files = settings->bools.video_shader_watch_files;
|
||||
|
||||
(void)file_list;
|
||||
|
||||
@ -746,7 +747,7 @@ bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
|
||||
strlcpy(shader->path, conf->path, sizeof(shader->path));
|
||||
|
||||
if (settings->bools.video_shader_watch_files)
|
||||
if (watch_files)
|
||||
{
|
||||
if (file_change_data)
|
||||
frontend_driver_watch_path_for_changes(NULL,
|
||||
@ -769,12 +770,12 @@ bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (settings->bools.video_shader_watch_files && file_list)
|
||||
if (watch_files && file_list)
|
||||
string_list_append(file_list,
|
||||
shader->pass[i].source.path, attr);
|
||||
}
|
||||
|
||||
if (settings->bools.video_shader_watch_files)
|
||||
if (watch_files)
|
||||
{
|
||||
int flags = PATH_CHANGE_TYPE_MODIFIED |
|
||||
PATH_CHANGE_TYPE_WRITE_FILE_CLOSED |
|
||||
@ -938,7 +939,7 @@ static void shader_write_variable(config_file_t *conf,
|
||||
}
|
||||
|
||||
/**
|
||||
* video_shader_write_conf_cgp:
|
||||
* video_shader_write_conf_preset:
|
||||
* @conf : Preset file to write to.
|
||||
* @shader : Shader passes handle.
|
||||
* @preset_path : Optional path to where the preset will be written.
|
||||
@ -948,7 +949,7 @@ static void shader_write_variable(config_file_t *conf,
|
||||
* If @preset_path is not NULL, shader paths are saved
|
||||
* relative to it.
|
||||
**/
|
||||
void video_shader_write_conf_cgp(config_file_t *conf,
|
||||
void video_shader_write_conf_preset(config_file_t *conf,
|
||||
struct video_shader *shader, const char *preset_path)
|
||||
{
|
||||
unsigned i;
|
||||
|
@ -169,7 +169,7 @@ struct video_shader
|
||||
};
|
||||
|
||||
/**
|
||||
* video_shader_read_conf_cgp:
|
||||
* video_shader_read_conf_preset:
|
||||
* @conf : Preset file to read from.
|
||||
* @shader : Shader passes handle.
|
||||
*
|
||||
@ -178,11 +178,11 @@ struct video_shader
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
bool video_shader_read_conf_preset(config_file_t *conf,
|
||||
struct video_shader *shader);
|
||||
|
||||
/**
|
||||
* video_shader_write_conf_cgp:
|
||||
* video_shader_write_conf_preset:
|
||||
* @conf : Preset file to write to.
|
||||
* @shader : Shader passes handle.
|
||||
* @preset_path : Optional path to where the preset will be written.
|
||||
@ -192,7 +192,7 @@ bool video_shader_read_conf_cgp(config_file_t *conf,
|
||||
* If @preset_path is not NULL, shader paths are saved
|
||||
* relative to it.
|
||||
**/
|
||||
void video_shader_write_conf_cgp(config_file_t *conf,
|
||||
void video_shader_write_conf_preset(config_file_t *conf,
|
||||
struct video_shader *shader, const char *preset_path);
|
||||
|
||||
/**
|
||||
|
@ -123,7 +123,7 @@ bool menu_shader_manager_init(void)
|
||||
|
||||
if (
|
||||
!string_is_empty(new_path) && conf &&
|
||||
video_shader_read_conf_cgp(conf, menu_driver_shader)
|
||||
video_shader_read_conf_preset(conf, menu_driver_shader)
|
||||
)
|
||||
{
|
||||
video_shader_resolve_relative(menu_driver_shader, new_path);
|
||||
@ -181,7 +181,7 @@ bool menu_shader_manager_set_preset(void *data,
|
||||
|
||||
RARCH_LOG("Setting Menu shader: %s.\n", preset_path);
|
||||
|
||||
if (video_shader_read_conf_cgp(conf, shader))
|
||||
if (video_shader_read_conf_preset(conf, shader))
|
||||
{
|
||||
video_shader_resolve_relative(shader, preset_path);
|
||||
video_shader_resolve_parameters(conf, shader);
|
||||
@ -321,7 +321,7 @@ bool menu_shader_manager_save_preset(
|
||||
if (!string_is_empty(basename))
|
||||
strlcpy(preset_path, buffer, sizeof(preset_path));
|
||||
|
||||
video_shader_write_conf_cgp(conf, shader, preset_path);
|
||||
video_shader_write_conf_preset(conf, shader, preset_path);
|
||||
|
||||
if (config_file_write(conf, preset_path, false))
|
||||
{
|
||||
@ -343,7 +343,7 @@ bool menu_shader_manager_save_preset(
|
||||
fill_pathname_join(preset_path, dirs[d],
|
||||
buffer, sizeof(preset_path));
|
||||
|
||||
video_shader_write_conf_cgp(conf, shader, preset_path);
|
||||
video_shader_write_conf_preset(conf, shader, preset_path);
|
||||
|
||||
if (config_file_write(conf, preset_path, false))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user