only create shaders after shadercaches are initialized

This commit is contained in:
degasus 2013-01-26 16:33:54 +01:00
parent 13e9bb56f8
commit 3a52b37c3b
1 changed files with 4 additions and 4 deletions

View File

@ -190,8 +190,6 @@ void VideoBackend::Video_Prepare()
CommandProcessor::Init(); CommandProcessor::Init();
PixelEngine::Init(); PixelEngine::Init();
g_texture_cache = new TextureCache;
BPInit(); BPInit();
g_vertex_manager = new VertexManager; g_vertex_manager = new VertexManager;
Fifo_Init(); // must be done before OpcodeDecoder_Init() Fifo_Init(); // must be done before OpcodeDecoder_Init()
@ -201,6 +199,7 @@ void VideoBackend::Video_Prepare()
PixelShaderCache::Init(); PixelShaderCache::Init();
PixelShaderManager::Init(); PixelShaderManager::Init();
ProgramShaderCache::Init(); ProgramShaderCache::Init();
g_texture_cache = new TextureCache;
PostProcessing::Init(); PostProcessing::Init();
Renderer::Init(); Renderer::Init();
GL_REPORT_ERRORD(); GL_REPORT_ERRORD();
@ -230,17 +229,18 @@ void VideoBackend::Shutdown()
Renderer::Shutdown(); Renderer::Shutdown();
TextureConverter::Shutdown(); TextureConverter::Shutdown();
VertexLoaderManager::Shutdown(); VertexLoaderManager::Shutdown();
delete g_texture_cache;
g_texture_cache = NULL;
ProgramShaderCache::Shutdown(); ProgramShaderCache::Shutdown();
VertexShaderCache::Shutdown(); VertexShaderCache::Shutdown();
VertexShaderManager::Shutdown(); VertexShaderManager::Shutdown();
PixelShaderManager::Shutdown(); PixelShaderManager::Shutdown();
PixelShaderCache::Shutdown(); PixelShaderCache::Shutdown();
delete g_vertex_manager; delete g_vertex_manager;
delete g_texture_cache; g_vertex_manager = NULL;
OpcodeDecoder_Shutdown(); OpcodeDecoder_Shutdown();
delete g_renderer; delete g_renderer;
g_renderer = NULL; g_renderer = NULL;
g_texture_cache = NULL;
} }
GLInterface->Shutdown(); GLInterface->Shutdown();
} }