1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Group sparse mesh buffers over entire scene for rendering

This commit is contained in:
sfan5 2024-12-11 14:44:49 +01:00
parent 612d4f9656
commit d2a7875b5b
11 changed files with 267 additions and 144 deletions

View file

@ -16,13 +16,13 @@ void OpenGLVBO::upload(const void *data, size_t size, size_t offset,
GLenum usage, bool mustShrink)
{
bool newBuffer = false;
assert(!(mustShrink && offset > 0)); // forbidden usage
if (!m_name) {
GL.GenBuffers(1, &m_name);
if (!m_name)
return;
newBuffer = true;
} else if (size > m_size || mustShrink) {
// note: mustShrink && offset > 0 is forbidden
newBuffer = size != m_size;
}