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).
This commit is contained in:
paradust7 2024-02-12 14:20:48 -08:00 committed by GitHub
parent a14320fc44
commit e2ccd14c05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

@ -114,12 +114,6 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
m_rendering_engine->setupTopLevelWindow(); 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 // Create game callback for menus
g_gamecallback = new MainGameCallback(); g_gamecallback = new MainGameCallback();

@ -152,6 +152,9 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
driver = m_device->getVideoDriver(); driver = m_device->getVideoDriver();
infostream << "Using the " << RenderingEngine::getVideoDriverInfo(driver->getDriverType()).friendly_name << " video driver" << std::endl; 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; s_singleton = this;
auto skin = createSkin(m_device->getGUIEnvironment(), auto skin = createSkin(m_device->getGUIEnvironment(),