diff --git a/core/renderer/backend/opengl/ProgramGL.cpp b/core/renderer/backend/opengl/ProgramGL.cpp index 265c43b071..ec88a0fc47 100644 --- a/core/renderer/backend/opengl/ProgramGL.cpp +++ b/core/renderer/backend/opengl/ProgramGL.cpp @@ -431,6 +431,11 @@ void UniformBlockDescriptor::bindUniformBlock(GLint _program, UniformBlockStage const char* blockName = stage == UniformBlockStage::VERTEX ? "vs_ub" : "fs_ub"; blockIndex = glGetUniformBlockIndex(_program, blockName); + if (blockIndex == GL_INVALID_INDEX) + { + stage = UniformBlockStage::UBO_NOT_FOUND; + return; + } bindingPoint = (GLint)stage - 1; glUniformBlockBinding(_program, blockIndex, bindingPoint);