diff --git a/lib/graphicsdev/GL.cpp b/lib/graphicsdev/GL.cpp index 4729651..d9840c9 100644 --- a/lib/graphicsdev/GL.cpp +++ b/lib/graphicsdev/GL.cpp @@ -599,27 +599,33 @@ struct GLShaderDataBinding : IShaderDataBinding m_vtxFormat->bind(b); if (m_ubufOffs.size()) { - for (size_t i=0 ; im_uniLocs.size() ; ++i) { + GLint loc = m_pipeline->m_uniLocs[i]; + if (loc < 0) + continue; IGraphicsBuffer* ubuf = m_ubufs[i]; const std::pair& offset = m_ubufOffs[i]; if (ubuf->dynamic()) static_cast(ubuf)->bindUniformRange(i, offset.first, offset.second, b); else static_cast(ubuf)->bindUniformRange(i, offset.first, offset.second); - glUniformBlockBinding(prog, m_pipeline->m_uniLocs.at(i), i); + glUniformBlockBinding(prog, loc, i); } } else { - for (size_t i=0 ; im_uniLocs.size() ; ++i) { + GLint loc = m_pipeline->m_uniLocs[i]; + if (loc < 0) + continue; IGraphicsBuffer* ubuf = m_ubufs[i]; if (ubuf->dynamic()) static_cast(ubuf)->bindUniform(i, b); else static_cast(ubuf)->bindUniform(i); - glUniformBlockBinding(prog, m_pipeline->m_uniLocs.at(i), i); + glUniformBlockBinding(prog, loc, i); } } for (size_t i=0 ; i