1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +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

@ -1144,6 +1144,10 @@ CNullDriver::SHWBufferLink *CNullDriver::getBufferLink(const scene::IIndexBuffer
//! Update all hardware buffers, remove unused ones
void CNullDriver::updateAllHardwareBuffers()
{
// FIXME: this method can take a lot of time just doing the refcount
// checks and iteration (too much pointer chasing?) for
// large buffer counts (e.g. 50000)
auto it = HWBufferList.begin();
while (it != HWBufferList.end()) {
SHWBufferLink *Link = *it;

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;
}

View file

@ -13,7 +13,7 @@ namespace video
/// OpenGL 3+ driver
///
/// For OpenGL 3.2 and higher. Compatibility profile is required currently.
class COpenGL3Driver : public COpenGL3DriverBase
class COpenGL3Driver final : public COpenGL3DriverBase
{
friend IVideoDriver *createOpenGL3Driver(const SIrrlichtCreationParameters &params, io::IFileSystem *io, IContextManager *contextManager);

View file

@ -13,7 +13,7 @@ namespace video
/// OpenGL ES 2+ driver
///
/// For OpenGL ES 2.0 and higher.
class COpenGLES2Driver : public COpenGL3DriverBase
class COpenGLES2Driver final : public COpenGL3DriverBase
{
friend IVideoDriver *createOGLES2Driver(const SIrrlichtCreationParameters &params, io::IFileSystem *io, IContextManager *contextManager);