Skip to content

Commit

Permalink
Allow using VBOs for meshes all the way down to 4 vertices (#14366)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
paradust7 committed Feb 12, 2024
1 parent a14320f commit e2ccd14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/client/clientlauncher.cpp
Expand Up @@ -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();

Expand Down
3 changes: 3 additions & 0 deletions src/client/renderingengine.cpp
Expand Up @@ -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(),
Expand Down

0 comments on commit e2ccd14

Please sign in to comment.