mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-12 12:58:34 +00:00
Create video_shader_driver_get_current_shader
This commit is contained in:
parent
7eef22dbe0
commit
b777f019bf
@ -68,3 +68,14 @@ const shader_backend_t *shader_ctx_init_first(void)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct video_shader *video_shader_driver_get_current_shader(void)
|
||||||
|
{
|
||||||
|
if (!driver.video_poke)
|
||||||
|
return NULL;
|
||||||
|
if (!driver.video_data)
|
||||||
|
return NULL;
|
||||||
|
if (!driver.video_poke->get_current_shader)
|
||||||
|
return NULL;
|
||||||
|
return driver.video_poke->get_current_shader(driver.video_data);
|
||||||
|
}
|
||||||
|
@ -103,4 +103,6 @@ const shader_backend_t *shader_ctx_find_driver(const char *ident);
|
|||||||
**/
|
**/
|
||||||
const shader_backend_t *shader_ctx_init_first(void);
|
const shader_backend_t *shader_ctx_init_first(void);
|
||||||
|
|
||||||
|
struct video_shader *video_shader_driver_get_current_shader(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1934,11 +1934,8 @@ static int action_start_shader_action_parameter(unsigned type, const char *label
|
|||||||
unsigned action)
|
unsigned action)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
struct video_shader *shader = NULL;
|
|
||||||
struct video_shader_parameter *param = NULL;
|
struct video_shader_parameter *param = NULL;
|
||||||
|
struct video_shader *shader = video_shader_driver_get_current_shader();
|
||||||
if (driver.video_poke && driver.video_data && driver.video_poke->get_current_shader)
|
|
||||||
shader = driver.video_poke->get_current_shader(driver.video_data);
|
|
||||||
|
|
||||||
if (!shader)
|
if (!shader)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1976,11 +1973,8 @@ static int shader_action_parameter_toggle(unsigned type, const char *label,
|
|||||||
unsigned action)
|
unsigned action)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
struct video_shader *shader = NULL;
|
|
||||||
struct video_shader_parameter *param = NULL;
|
struct video_shader_parameter *param = NULL;
|
||||||
|
struct video_shader *shader = video_shader_driver_get_current_shader();
|
||||||
if (driver.video_poke && driver.video_data && driver.video_poke->get_current_shader)
|
|
||||||
shader = driver.video_poke->get_current_shader(driver.video_data);
|
|
||||||
|
|
||||||
if (!shader)
|
if (!shader)
|
||||||
return 0;
|
return 0;
|
||||||
@ -2992,9 +2986,8 @@ static inline struct video_shader *shader_manager_get_current_shader(const char
|
|||||||
|
|
||||||
if (!strcmp(label, "video_shader_preset_parameters"))
|
if (!strcmp(label, "video_shader_preset_parameters"))
|
||||||
return menu->shader;
|
return menu->shader;
|
||||||
else if (!strcmp(label, "video_shader_parameters") &&
|
else if (!strcmp(label, "video_shader_parameters"))
|
||||||
driver.video_poke && driver.video_data && driver.video_poke->get_current_shader)
|
return video_shader_driver_get_current_shader();
|
||||||
return driver.video_poke->get_current_shader(driver.video_data);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3041,10 +3034,7 @@ static int deferred_push_video_shader_preset_parameters(void *data, void *userda
|
|||||||
static int deferred_push_video_shader_parameters(void *data, void *userdata,
|
static int deferred_push_video_shader_parameters(void *data, void *userdata,
|
||||||
const char *path, const char *label, unsigned type)
|
const char *path, const char *label, unsigned type)
|
||||||
{
|
{
|
||||||
struct video_shader *shader = NULL;
|
struct video_shader *shader = video_shader_driver_get_current_shader();
|
||||||
if (driver.video_poke && driver.video_data && driver.video_poke->get_current_shader)
|
|
||||||
shader = driver.video_poke->get_current_shader(driver.video_data);
|
|
||||||
|
|
||||||
if (!shader)
|
if (!shader)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -4708,10 +4698,7 @@ static void menu_action_setting_disp_set_label_shader_parameter(
|
|||||||
strlcpy(path_buf, path, path_buf_size);
|
strlcpy(path_buf, path, path_buf_size);
|
||||||
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
||||||
if (!driver.video_poke->get_current_shader)
|
shader = video_shader_driver_get_current_shader();
|
||||||
return;
|
|
||||||
|
|
||||||
shader = driver.video_poke->get_current_shader(driver.video_data);
|
|
||||||
|
|
||||||
if (!shader)
|
if (!shader)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user