Create video_shader_driver_init
This commit is contained in:
parent
736101f1a2
commit
11109a198b
|
@ -275,15 +275,12 @@ static bool gl_shader_init(gl_t *gl)
|
|||
|
||||
gl->shader = backend;
|
||||
|
||||
if (gl->shader && gl->shader->init)
|
||||
{
|
||||
ret = gl->shader->init(gl, shader_path);
|
||||
ret = video_shader_init(gl->shader, gl, shader_path);
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
RARCH_ERR("[GL]: Failed to initialize shader, falling back to stock.\n");
|
||||
ret = gl->shader->init(gl, NULL);
|
||||
}
|
||||
if (!ret)
|
||||
{
|
||||
RARCH_ERR("[GL]: Failed to initialize shader, falling back to stock.\n");
|
||||
ret = video_shader_init(gl->shader, gl, NULL);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -92,3 +92,10 @@ void video_shader_scale(unsigned idx,
|
|||
if (shader->shader_scale)
|
||||
shader->shader_scale(idx, scale);
|
||||
}
|
||||
|
||||
bool video_shader_init(const shader_backend_t *shader, void *data, const char *path)
|
||||
{
|
||||
if (!shader || !shader->init)
|
||||
return false;
|
||||
return shader->init(data, path);
|
||||
}
|
||||
|
|
|
@ -116,6 +116,8 @@ const shader_backend_t *shader_ctx_init_first(void);
|
|||
|
||||
struct video_shader *video_shader_driver_get_current_shader(void);
|
||||
|
||||
bool video_shader_init(const shader_backend_t *shader, void *data, const char *path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue