From e2ccd14c0526adf88fa56dfcfd0e998492b01b03 Mon Sep 17 00:00:00 2001 From: paradust7 <102263465+paradust7@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:20:48 -0800 Subject: [PATCH] Allow using VBOs for meshes all the way down to 4 vertices (#14366) This may improve performance substantially if there are many meshes with "few" vertices that would otherwise be retransmitted to the GPU every frame. In testing, this does not seem to decrease performance, even if as few as 4 vertices are used (e.g. particles). --- src/client/clientlauncher.cpp | 6 ------ src/client/renderingengine.cpp | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index aaaf5c483..fd5bcb19d 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -114,12 +114,6 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args) m_rendering_engine->setupTopLevelWindow(); - /* - This changes the minimum allowed number of vertices in a VBO. - Default is 500. - */ - //driver->setMinHardwareBufferVertexCount(50); - // Create game callback for menus g_gamecallback = new MainGameCallback(); diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index 35a27b1f0..c1a51d289 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -152,6 +152,9 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver) driver = m_device->getVideoDriver(); infostream << "Using the " << RenderingEngine::getVideoDriverInfo(driver->getDriverType()).friendly_name << " video driver" << std::endl; + // This changes the minimum allowed number of vertices in a VBO. Default is 500. + driver->setMinHardwareBufferVertexCount(4); + s_singleton = this; auto skin = createSkin(m_device->getGUIEnvironment(),