Create video_shader_driver_init

This commit is contained in:
twinaphex 2015-12-04 15:50:40 +01:00
parent 736101f1a2
commit 11109a198b
3 changed files with 14 additions and 8 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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