1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improve robustness of GL object handling

This commit is contained in:
sfan5 2025-03-12 19:46:12 +01:00
parent 077828d0d9
commit 4b85062caf
4 changed files with 23 additions and 2 deletions

View file

@ -212,6 +212,7 @@ void COpenGL3DriverBase::initQuadsIndices(u32 max_vertex_count)
}
QuadIndexVBO.upload(QuadsIndices.data(), QuadsIndices.size() * sizeof(u16),
0, GL_STATIC_DRAW, true);
assert(QuadIndexVBO.exists());
}
void COpenGL3DriverBase::initVersion()
@ -626,6 +627,7 @@ void COpenGL3DriverBase::drawBuffers(const scene::IVertexBuffer *vb,
const void *vertices = vb->getData();
if (hwvert) {
assert(hwvert->IsVertex);
assert(hwvert->Vbo.exists());
GL.BindBuffer(GL_ARRAY_BUFFER, hwvert->Vbo.getName());
vertices = nullptr;
}
@ -633,6 +635,7 @@ void COpenGL3DriverBase::drawBuffers(const scene::IVertexBuffer *vb,
const void *indexList = ib->getData();
if (hwidx) {
assert(!hwidx->IsVertex);
assert(hwidx->Vbo.exists());
GL.BindBuffer(GL_ELEMENT_ARRAY_BUFFER, hwidx->Vbo.getName());
indexList = nullptr;
}