Disable UBO buffer generation if hardware doesn't support it.

This commit is contained in:
Ryan Houdek 2011-12-11 04:19:11 -06:00
parent df283a56a0
commit fbef258dab
1 changed files with 28 additions and 24 deletions

View File

@ -169,6 +169,8 @@ namespace OGL
// We have to get the UBO alignment here because
// if we generate a buffer that isn't aligned
// then the UBO will fail.
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
{
GLint Align;
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &Align);
@ -188,12 +190,14 @@ namespace OGL
glBufferData(GL_UNIFORM_BUFFER, ROUND_UP(C_VENVCONST_END * 4 * 4, Align), NULL, GL_DYNAMIC_DRAW);
glBindBufferBase(GL_UNIFORM_BUFFER, 2, UBOBuffers[1]);
}
}
void ProgramShaderCache::Shutdown(void)
{
PCache::iterator iter = pshaders.begin();
for (; iter != pshaders.end(); iter++)
iter->second.Destroy();
pshaders.clear();
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
glDeleteBuffers(2, UBOBuffers);
}
}