From 0ea15de950b610253c59b031714ebf819f8486ac Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 27 May 2014 21:55:54 +0200 Subject: [PATCH] (GL) Force fp_fbo to false for PS3 for now --- driver.c | 2 +- gfx/gl.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/driver.c b/driver.c index 2266b8cd25..a2e8ef7199 100644 --- a/driver.c +++ b/driver.c @@ -511,11 +511,11 @@ void global_init_drivers(void) { find_audio_driver(); find_input_driver(); - init_video_input(); find_image_driver(); #ifdef HAVE_MENU find_menu_driver(); #endif + init_video_input(); } void global_uninit_drivers(void) diff --git a/gfx/gl.c b/gfx/gl.c index 474235f047..acac14be9a 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -205,6 +205,7 @@ static bool check_fbo_proc(gl_t *gl) static bool gl_shader_init(void *data) { + bool ret; gl_t *gl = (gl_t*)data; const gl_shader_backend_t *backend = NULL; @@ -214,6 +215,8 @@ static bool gl_shader_init(void *data) enum rarch_shader_type type = gfx_shader_parse_type(shader_path, gl->core_context ? RARCH_SHADER_GLSL : DEFAULT_SHADER_TYPE); + ret = 0; + if (type == RARCH_SHADER_NONE) { RARCH_LOG("[GL]: Not loading any shader.\n"); @@ -256,7 +259,10 @@ static bool gl_shader_init(void *data) #endif gl->shader = backend; - bool ret = gl->shader->init(gl, shader_path); + + if (gl->shader && gl->shader->init) + ret = gl->shader->init(gl, shader_path); + if (!ret) { RARCH_ERR("[GL]: Failed to init shader, falling back to stock.\n"); @@ -270,6 +276,9 @@ static inline void gl_shader_deinit(void *data) { gl_t *gl = (gl_t*)data; + if (!gl) + return; + if (gl->shader) gl->shader->deinit(); gl->shader = NULL; @@ -295,7 +304,7 @@ static void gl_set_coords(const struct gl_coords *coords) static void gl_disable_client_arrays(gl_t *gl) { - if (gl->core_context) + if (!gl || gl->core_context) return; glClientActiveTexture(GL_TEXTURE1); @@ -1826,7 +1835,11 @@ static bool resolve_extensions(gl_t *gl) #else #ifdef HAVE_FBO // Float FBO is core in 3.2. +#ifdef HAVE_PSGL + gl->has_fp_fbo = false; // FIXME - rewrite GL implementation +#else gl->has_fp_fbo = gl->core_context || gl_query_extension(gl, "ARB_texture_float"); +#endif gl->has_srgb_fbo = gl->core_context || (gl_query_extension(gl, "EXT_texture_sRGB") && gl_query_extension(gl, "ARB_framebuffer_sRGB")); #endif #endif