godotengine / godotengine/godot

Performance.get_monitor(Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME) includes all UI elements, including indivudal letters

Open
#90,133 7 comments 4 reactions 0 assignees View on GitHub
discussion documentation topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in 4.3.dev5
- Not reproducible in 4.2.1 Stable

### System information

Godot v4.2.1.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 31.0.15.5186) - Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 Threads)

### Issue description

I've been using Performance.get_monitor(Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME) to help monitor my draw calls, and when I imported my project into 4.3, I noticed there were a lot more calls, even on relatively simple scenes.

I soon realized that Performance.get_monitor(Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME) and
Performance.get_monitor(Performance.RENDER_TOTAL_OBJECTS_IN_FRAME)) now counts all UI elements in their calls. To the point where each individual letter typed on the screen adds to the draw call count.

This strikes me as a regression, as the UI elements are constantly changing and I need stable numbers to help with my optimization of lighting and 3d geometry.

In 4.2 only the cube is counted as a draw call.

![image](https://github.com/godotengine/godot/assets/9627628/5099d80d-5485-488f-b798-bf5c17c17375)

but in 4.3...

![image](https://github.com/godotengine/godot/assets/9627628/ca39cf21-29d2-430f-9eb1-534ac6ee9bbe)

![image](https://github.com/godotengine/godot/assets/9627628/c1bcf564-3e27-434d-a058-72fd1f12f50e)

### Steps to reproduce

Download MRP .zip
Open the 4.2 version, open test_draw_call.tscn, run it and notice there's only one draw call.
Open the 4.3 version, which is identical, and notice the draw calls go up with every letter typed.

### Minimal reproduction project (MRP)

[Draw Call Test.zip](https://github.com/godotengine/godot/files/14837195/Draw.Call.Test.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached Draw Call Test.zip and run test_draw_call.tscn in both the 4.2 and 4.3 versions, observing Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME and Performance.RENDER_TOTAL_OBJECTS_IN_FRAME while typing. Done should restore stable counts for the scene so individual UI letters do not increase the reported draw-call and object totals.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.