Revert "Cleanups"

This reverts commit 45546697508a4e45297a459741e0daec95462e30.
This commit is contained in:
twinaphex 2019-02-03 19:40:27 +01:00
parent 5a45464bb3
commit 1eeb58c5dd
4 changed files with 22 additions and 6 deletions

View File

@ -1091,9 +1091,10 @@ static void gl2_renderchain_init(
video_shader_ctx_info_t shader_info;
struct gfx_fbo_scale scale, scale_last;
shader_info.num = gl->shader->num_shaders(gl->shader_data);
if (!video_shader_driver_info(&shader_info))
return;
if (shader_info.num == 0)
if (!gl || shader_info.num == 0)
return;
video_driver_get_size(&width, &height);
@ -3438,7 +3439,11 @@ static void *gl_init(const video_info_t *video,
gl->textures = MAX(minimum + 1, gl->textures);
}
shader_info.num = gl->shader->num_shaders(gl->shader_data);
if (!video_shader_driver_info(&shader_info))
{
RARCH_ERR("[GL]: Shader driver info check failed.\n");
goto error;
}
RARCH_LOG("[GL]: Using %u textures.\n", gl->textures);
RARCH_LOG("[GL]: Loaded %u program(s).\n",

View File

@ -3562,6 +3562,16 @@ bool video_shader_driver_init(video_shader_ctx_init_t *init)
return true;
}
bool video_shader_driver_info(video_shader_ctx_info_t *shader_info)
{
if (!shader_info)
return false;
shader_info->num = current_shader->num_shaders(current_shader_data);
return true;
}
void video_driver_set_coords(video_shader_ctx_coords_t *coords)
{
if (current_shader && current_shader->set_coords)

View File

@ -1182,16 +1182,18 @@ void video_context_driver_free(void);
bool video_shader_driver_get_ident(video_shader_ctx_ident_t *ident);
bool video_shader_driver_get_current_shader(video_shader_ctx_t *shader);
bool video_shader_driver_deinit(void);
bool video_shader_driver_init_first(void);
bool video_shader_driver_get_current_shader(video_shader_ctx_t *shader);
bool video_shader_driver_init(video_shader_ctx_init_t *init);
void video_driver_set_coords(video_shader_ctx_coords_t *coords);
bool video_shader_driver_info(video_shader_ctx_info_t *shader_info);
void video_driver_set_mvp(video_shader_ctx_mvp_t *mvp);
float video_driver_get_refresh_rate(void);

View File

@ -28,7 +28,6 @@ extern "C" {
#include <file/file_path.h>
#include "../../../command.h"
#include "../../../configuration.h"
#include "../../../gfx/video_driver.h"
#include "../../../retroarch.h"
#include "../../../paths.h"
#include "../../../file_path_special.h"