mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Create SHADER_CTL_INIT_FIRST
This commit is contained in:
parent
f906e828ba
commit
fe3c3f5203
@ -2683,7 +2683,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
hw_render->version_major, hw_render->version_minor);
|
||||
#endif
|
||||
|
||||
if (!video_shader_driver_init_first())
|
||||
if (!video_shader_driver_ctl(SHADER_CTL_INIT_FIRST, NULL))
|
||||
goto error;
|
||||
|
||||
RARCH_LOG("[GL]: Default shader backend found: %s.\n",
|
||||
|
@ -58,26 +58,6 @@ const shader_backend_t *shader_ctx_find_driver(const char *ident)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* video_shader_driver_init_first:
|
||||
*
|
||||
* Finds first suitable shader context driver.
|
||||
*
|
||||
* Returns: true (1) if found, otherwise false (0).
|
||||
**/
|
||||
bool video_shader_driver_init_first(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; shader_ctx_drivers[i]; i++)
|
||||
{
|
||||
current_shader = shader_ctx_drivers[i];
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
struct video_shader *video_shader_driver_get_current_shader(void)
|
||||
{
|
||||
void *video_driver = video_driver_get_ptr(false);
|
||||
@ -233,6 +213,18 @@ bool video_shader_driver_ctl(enum video_shader_driver_ctl_state state, void *dat
|
||||
params->fbo_info_cnt);
|
||||
}
|
||||
break;
|
||||
/* Finds first suitable shader context driver. */
|
||||
case SHADER_CTL_INIT_FIRST:
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; shader_ctx_drivers[i]; i++)
|
||||
{
|
||||
current_shader = shader_ctx_drivers[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case SHADER_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
|
@ -33,6 +33,8 @@ extern "C" {
|
||||
enum video_shader_driver_ctl_state
|
||||
{
|
||||
SHADER_CTL_NONE = 0,
|
||||
/* Finds first suitable shader context driver. */
|
||||
SHADER_CTL_INIT_FIRST,
|
||||
SHADER_CTL_SET_PARAMS
|
||||
};
|
||||
|
||||
@ -130,15 +132,6 @@ void video_shader_driver_scale(unsigned idx, struct gfx_fbo_scale *scale);
|
||||
**/
|
||||
const shader_backend_t *shader_ctx_find_driver(const char *ident);
|
||||
|
||||
/**
|
||||
* video_shader_driver_init_first:
|
||||
*
|
||||
* Finds first suitable shader context driver.
|
||||
*
|
||||
* Returns: shader context driver if found, otherwise NULL.
|
||||
**/
|
||||
bool video_shader_driver_init_first(void);
|
||||
|
||||
struct video_shader *video_shader_driver_get_current_shader(void);
|
||||
|
||||
bool video_shader_driver_init(const shader_backend_t *shader,
|
||||
|
Loading…
x
Reference in New Issue
Block a user