Move the GLSL extension checks over here so it is nicer.

This commit is contained in:
Ryan Houdek 2011-12-20 21:55:11 -06:00
parent f6b33cf0be
commit dc134b9bac
2 changed files with 11 additions and 10 deletions

View File

@ -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
{

View File

@ -312,6 +312,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);