1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Items and draw calls added to IDE Monitor in '2d' section

This adds 2 new values (items and draw calls) to the performance monitor in a '2d' section, rather than reusing the 3d values in the 'raster' section.

This makes it far easier to optimize games to minimize drawcalls.
This commit is contained in:
lawnjelly
2020-04-16 11:46:52 +01:00
parent a4cd274ca7
commit b6d652367b
10 changed files with 56 additions and 1 deletions

View File

@@ -2188,6 +2188,8 @@ void VisualServer::_bind_methods() {
BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME);
BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME);
BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME);
BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_2D_ITEMS_IN_FRAME);
BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_2D_DRAW_CALLS_IN_FRAME);
BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_MAX);
BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_DISABLED);
@@ -2247,6 +2249,8 @@ void VisualServer::_bind_methods() {
BIND_ENUM_CONSTANT(INFO_SHADER_CHANGES_IN_FRAME);
BIND_ENUM_CONSTANT(INFO_SURFACE_CHANGES_IN_FRAME);
BIND_ENUM_CONSTANT(INFO_DRAW_CALLS_IN_FRAME);
BIND_ENUM_CONSTANT(INFO_2D_ITEMS_IN_FRAME);
BIND_ENUM_CONSTANT(INFO_2D_DRAW_CALLS_IN_FRAME);
BIND_ENUM_CONSTANT(INFO_USAGE_VIDEO_MEM_TOTAL);
BIND_ENUM_CONSTANT(INFO_VIDEO_MEM_USED);
BIND_ENUM_CONSTANT(INFO_TEXTURE_MEM_USED);
@@ -2418,7 +2422,7 @@ VisualServer::VisualServer() {
GLOBAL_DEF("rendering/gles2/batching/light_scissor_area_threshold", 1.0f);
GLOBAL_DEF("rendering/gles2/batching/batch_buffer_size", 16384);
GLOBAL_DEF("rendering/gles2/debug/flash_batching", false);
GLOBAL_DEF_RST("rendering/gles2/debug/use_batching_in_editor", false);
GLOBAL_DEF_RST("rendering/gles2/debug/use_batching_in_editor", true);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/gles2/batching/max_join_item_commands", PropertyInfo(Variant::INT, "rendering/gles2/batching/max_join_item_commands", PROPERTY_HINT_RANGE, "0,65535"));
ProjectSettings::get_singleton()->set_custom_property_info("rendering/gles2/batching/colored_vertex_format_threshold", PropertyInfo(Variant::REAL, "rendering/gles2/batching/colored_vertex_format_threshold", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"));