Do not call UBO functions when no extension available

This commit is contained in:
alexey.lysiuk 2016-05-01 11:46:49 +03:00
parent 138c6ea25e
commit 1deb9742de

View file

@ -294,8 +294,11 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
modelmatrix_index = glGetUniformLocation(hShader, "ModelMatrix");
texturematrix_index = glGetUniformLocation(hShader, "TextureMatrix");
int tempindex = glGetUniformBlockIndex(hShader, "LightBufferUBO");
if (tempindex != -1) glUniformBlockBinding(hShader, tempindex, LIGHTBUF_BINDINGPOINT);
if (LM_SOFTWARE != gl.lightmethod)
{
int tempindex = glGetUniformBlockIndex(hShader, "LightBufferUBO");
if (tempindex != -1) glUniformBlockBinding(hShader, tempindex, LIGHTBUF_BINDINGPOINT);
}
glUseProgram(hShader);
@ -304,7 +307,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
{
char stringbuf[20];
mysnprintf(stringbuf, 20, "texture%d", i);
tempindex = glGetUniformLocation(hShader, stringbuf);
int tempindex = glGetUniformLocation(hShader, stringbuf);
if (tempindex > 0) glUniform1i(tempindex, i - 1);
}