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); }