These checks aren't needed when using CG.

This commit is contained in:
Ryan Houdek 2011-12-29 00:01:50 -06:00 committed by Sonicadvance1
parent e88d35d1c1
commit 5085cebaf3

View File

@ -314,22 +314,24 @@ Renderer::Renderer()
s_bHaveFramebufferBlit = strstr(ptoken, "GL_EXT_framebuffer_blit") != NULL; s_bHaveFramebufferBlit = strstr(ptoken, "GL_EXT_framebuffer_blit") != NULL;
s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL; s_bHaveCoverageMSAA = strstr(ptoken, "GL_NV_framebuffer_multisample_coverage") != NULL;
if(g_ActiveConfig.bUseGLSL)
// TODO: Switch over to using glew once 1.6/1.7 becomes more mainstream, seems most people are stuck in 1.5 {
if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_shading_language_420pack") != NULL) // TODO: Switch over to using glew once 1.6/1.7 becomes more mainstream, seems most people are stuck in 1.5
g_Config.backend_info.bSupportsGLSLBinding = true; if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_shading_language_420pack") != NULL)
if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_uniform_buffer_object") != NULL) g_Config.backend_info.bSupportsGLSLBinding = true;
g_Config.backend_info.bSupportsGLSLUBO = true; if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_uniform_buffer_object") != NULL)
if ((g_Config.backend_info.bSupportsGLSLBinding || g_Config.backend_info.bSupportsGLSLUBO) && strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_explicit_attrib_location") != NULL) g_Config.backend_info.bSupportsGLSLUBO = true;
g_Config.backend_info.bSupportsGLSLATTRBind = true; if ((g_Config.backend_info.bSupportsGLSLBinding || g_Config.backend_info.bSupportsGLSLUBO) && strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_explicit_attrib_location") != NULL)
if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_get_program_binary") != NULL) g_Config.backend_info.bSupportsGLSLATTRBind = true;
g_Config.backend_info.bSupportsGLSLCache = true; if (strstr((const char*)glGetString(GL_EXTENSIONS), "GL_ARB_get_program_binary") != NULL)
g_Config.backend_info.bSupportsGLSLCache = true;
UpdateActiveConfig();
OSD::AddMessage(StringFromFormat("Using GLSL. Supports Binding: %s UBOs: %s Cache: %s", UpdateActiveConfig();
g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "True" : "False", OSD::AddMessage(StringFromFormat("Using GLSL. Supports Binding: %s UBOs: %s Cache: %s",
g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "True" : "False", g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "True" : "False",
g_ActiveConfig.backend_info.bSupportsGLSLCache ? "True" : "False").c_str(), 5000); g_ActiveConfig.backend_info.bSupportsGLSLUBO ? "True" : "False",
g_ActiveConfig.backend_info.bSupportsGLSLCache ? "True" : "False").c_str(), 5000);
}
s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode; s_LastMultisampleMode = g_ActiveConfig.iMultisampleMode;
s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode); s_MSAASamples = GetNumMSAASamples(s_LastMultisampleMode);
@ -441,8 +443,8 @@ Renderer::Renderer()
#else #else
// If we don't have Nvidia CG, we HAVE to use GLSL // If we don't have Nvidia CG, we HAVE to use GLSL
g_Config.bUseGLSL = true; g_Config.bUseGLSL = true;
UpdateActiveConfig(); UpdateActiveConfig();
INFO_LOG(VIDEO, "CG not found, switching to GLSL");
#endif // HAVE_CG #endif // HAVE_CG
int nenvvertparams, nenvfragparams, naddrregisters[2]; int nenvvertparams, nenvfragparams, naddrregisters[2];