From 1deb9742de264c29005746f61adb19d5175cc4ba Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 1 May 2016 11:46:49 +0300 Subject: [PATCH] Do not call UBO functions when no extension available --- src/gl/shaders/gl_shader.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index 1d5afd359..d41adcbe7 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -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); }