From ac77bbd47b61dde38979addc758629cc7e2c40f5 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 20 Dec 2011 21:55:11 -0600 Subject: [PATCH] Move the GLSL extension checks over here so it is nicer. --- .../Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp | 10 ---------- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp index bb0f47db53..6840baded8 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp @@ -80,16 +80,6 @@ void PixelShaderCache::Init() pSetPSConstant4fv = SetGLSLPSConstant4fv; pSetMultiPSConstant4fv = SetMultiGLSLPSConstant4fv; pCompilePixelShader = CompileGLSLPixelShader; - // Should this be set here? - if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_shading_language_420pack") != NULL) - g_Config.backend_info.bSupportsGLSLBinding = true; - if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_uniform_buffer_object") != NULL) - g_Config.backend_info.bSupportsGLSLUBO = true; - - UpdateActiveConfig(); - OSD::AddMessage(StringFromFormat("Using GLSL. Supports Binding: %s UBOs: %s", - g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "True" : "False", - g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "True" : "False").c_str(), 5000); } else { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 8b70cf5b8f..cf8add6ed9 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -315,6 +315,17 @@ Renderer::Renderer() s_bHaveFramebufferBlit = strstr(ptoken, "GL_EXT_framebuffer_blit") != NULL; s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL; + + if (glewIsSupported("GL_ARB_shading_language_420pack")) + g_Config.backend_info.bSupportsGLSLBinding = true; + if (glewIsSupported("GL_ARB_uniform_buffer_object")) + g_Config.backend_info.bSupportsGLSLUBO = true; + + UpdateActiveConfig(); + OSD::AddMessage(StringFromFormat("Using GLSL. Supports Binding: %s UBOs: %s", + g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "True" : "False", + g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "True" : "False").c_str(), 5000); + s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode; s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode); s_MSAACoverageSamples = GetNumMSAACoverageSamples(s_LastMultisampleMode);