FIx GL error

This commit is contained in:
halx99 2023-07-18 15:16:29 +08:00
parent e52da4da43
commit c9436765b4
1 changed files with 5 additions and 0 deletions

View File

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