From 1a8005d9489b7eea7c840609913c7f249885cbba Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Wed, 18 Jan 2012 10:22:03 -0800 Subject: [PATCH] set ProgramShaderCache program format correctly. --- Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 5 ++++- Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index b178157a89..8f3378dca8 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -29,7 +29,7 @@ GLintptr ProgramShaderCache::s_vs_data_offset; LinearDiskCache g_program_disk_cache; GLenum ProgramFormat; -GLuint ProgramShaderCache::PCacheEntry::prog_format = ProgramShaderCache::PCacheEntry::SetProgramFormat(); +GLuint ProgramShaderCache::PCacheEntry::prog_format = 0; std::pair ProgramShaderCache::CurrentShaderProgram; const char *UniformNames[NUM_UNIFORMS] = @@ -215,9 +215,12 @@ void ProgramShaderCache::Init(void) // Read our shader cache, only if supported if (g_ActiveConfig.backend_info.bSupportsGLSLCache) { + PCacheEntry::prog_format = PCacheEntry::SetProgramFormat(); + char cache_filename[MAX_PATH]; sprintf(cache_filename, "%sogl-%s-shaders.cache", File::GetUserPath(D_SHADERCACHE_IDX).c_str(), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str()); + ProgramShaderCacheInserter inserter; g_program_disk_cache.OpenAndRead(cache_filename, inserter); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h index d4a12aac43..07e77e3eae 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h @@ -78,8 +78,6 @@ public: // No idea how necessary this is static GLenum SetProgramFormat() { - if(!g_ActiveConfig.backend_info.bSupportsGLSLCache) - return 0; GLint Supported; glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &Supported);