From 125a4e3c43f80db8c86061a090ab91eb8f5500ac Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 29 May 2014 01:35:24 +0200 Subject: [PATCH] (PS3 Cg) Fixed crash at game start - Cg state was never properly deinited for PS3 before and we relied on a very dirty hack to set CgContext to NULL - we can get rid of all that crap now. PS3 build is now 'fixed' - only thing remaining is that we should have a mechanism inside the menu to 'reinit' any graphics assets that were previously set before we lost the state (for instance - RMenu has one texture image it loads at init_assets time). --- gfx/gl.c | 3 --- gfx/shader_cg.c | 8 -------- gfx/shader_cg.h | 1 - 3 files changed, 12 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index f04d2ea2cf..225e910fba 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -2644,9 +2644,6 @@ static void gl_restart(void) void *data = driver.video_data; driver.video_data = NULL; gl_free(data); -#ifdef HAVE_CG - gl_cg_invalidate_context(); -#endif init_video_input(); } #endif diff --git a/gfx/shader_cg.c b/gfx/shader_cg.c index cfe5ea4f37..d0db603ab0 100644 --- a/gfx/shader_cg.c +++ b/gfx/shader_cg.c @@ -396,15 +396,12 @@ static void gl_cg_deinit_state(void) // Final deinit. static void gl_cg_deinit_context_state(void) { - // Destroying context breaks on PS3 for some unknown reason. -#ifndef __CELLOS_LV2__ if (cgCtx) { RARCH_LOG("CG: Destroying context.\n"); cgDestroyContext(cgCtx); cgCtx = NULL; } -#endif } // Full deinit. @@ -940,11 +937,6 @@ static struct gfx_shader *gl_cg_get_current_shader(void) return cg_active ? cg_shader : NULL; } -void gl_cg_invalidate_context(void) -{ - cgCtx = NULL; -} - const gl_shader_backend_t gl_cg_backend = { gl_cg_init, gl_cg_deinit, diff --git a/gfx/shader_cg.h b/gfx/shader_cg.h index b1507f5c3b..f4a6369ee3 100644 --- a/gfx/shader_cg.h +++ b/gfx/shader_cg.h @@ -20,7 +20,6 @@ #include "shader_common.h" #include -void gl_cg_invalidate_context(void); // Call when resetting GL context on PS3. extern const gl_shader_backend_t gl_cg_backend; #endif