New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outrageous lag caused by a full inventory #11305
Comments
Duplicate of #6905 |
Not sure what you meant here, sfinv is Minetest Game's inventory implementation. What you're showing in your screenshots is unified_inventory. |
On my system I count 24975 drawcalls with bricks and 7623 without(*), which makes a difference of ~18k.
You are correct, Items are drawn individually using this method: Lines 975 to 985 in e15cae9
Collecting matching meshes into one buffer shouldn't be much of a problem (translation, scaling and rotation would have to be done in software), all I can think if is using the same projection matrix for all of them might not be simple. There is a different problem though, our GUIs are drawn progressively and not "layer-for-layer" as would be helpful. This should illustrate it nicely: |
haha yeah i mixed up sfinv and unified_inventory |
Minetest version
OS / Hardware
Operating system: Debian Sid
CPU: Intel Core 2 Duo P8400 (2) @ 2.267GHz
GPU model: Intel Mobile 4 Series Chipset
OpenGL version: 3.3 Core
Summary
When opening a unified_inventory inventory filled with bricks, draw calls rise from about 4000/frame(!) to over 18000/frame(!!!!!!)
As a result on my worst machine, my frametimes go from about 20ms to 110ms, simply by looking at bricks.
This hints at the inventory list formspec element not putting each item inside a common vertex buffer. 12000 draw calls for a handful of half-cubes (prerendered to a single icon sprite i believe) and font glyphs is simply wrong.
Not only is item rendering sluggish, but an empty inventory takes a good bit of time to render (not nearly as bad though)
I'd say most formspecs of similar complexity are like this.
Inventory list rendering seriously needs to be batched, I'd like if someone could point me to a starting point on this matter.
Steps to reproduce
apitrace trace minetest
qapitrace minetest.trace
Inventory:
Draw call spike:
Trace file (opened inv, closed inv, opened again at the end):
minetest.trace.gz
The text was updated successfully, but these errors were encountered: