This repository has been archived by the owner on May 13, 2024. It is now read-only.
Allow VBO to be used for meshes all the way down to 4 vertices. #287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I used linux perf and GPUView (Windows) to examine rendering performance. I discovered in both cases that Minetest was CPU-bound, with the GPU barely being used. In particular, the CPU was spending most of its time in memory operations (CPU to GPU). I measured the transfer rate to be around 30GB/sec sustained.
Looking at the code, I discovered that the vast majority (80%) of map block meshes are under 500 vertices, and were therefore not being stored in VBOs, because of this arbitrary limit. They were being retransmitted in full every frame.
This boosts worst-case FPS (in Mineclonia) around 45% on my hardware, from 65fps to 95fps. (with default rendering distance)