From 13c4945b3a5822a50b555d617cf43bcb8a10704e Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 28 Jul 2022 19:37:52 +0200 Subject: [PATCH] Ported: Add INFO_SHADER_COMPILES_IN_FRAME to GL ES 3 render info - RandomShaper https://github.com/godotengine/godot/commit/f46d7583ff3df9562b3d8123d8f12c539d116336 --- doc/classes/VisualServer.xml | 22 ++++++++++++++-------- servers/visual_server.cpp | 1 + servers/visual_server.h | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index 279391db6..088087621 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -3197,28 +3197,34 @@ The amount of shader rebinds in the frame. - + + The peak amount of shaders that have been under compilation in the frame. + This is useful to know when asynchronous shader compilation has finished for the current shaders on screen. + [b]Note:[/b] For complete certainty, only assume there are no outstanding compilations when this value is zero for at least two frames in a row. + Unimplemented in the GLES2 rendering backend, always returns 0. + + The amount of surface changes in the frame. - + The amount of draw calls in frame. - + The amount of 2d items in the frame. - + The amount of 2d draw calls in frame. - + Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. - + The amount of video memory used, i.e. texture and vertex memory combined. - + The amount of texture memory used. - + The amount of vertex memory used. diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 26f1a180a..897c79eff 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -2392,6 +2392,7 @@ void VisualServer::_bind_methods() { BIND_ENUM_CONSTANT(INFO_VERTICES_IN_FRAME); BIND_ENUM_CONSTANT(INFO_MATERIAL_CHANGES_IN_FRAME); BIND_ENUM_CONSTANT(INFO_SHADER_CHANGES_IN_FRAME); + BIND_ENUM_CONSTANT(INFO_SHADER_COMPILES_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); diff --git a/servers/visual_server.h b/servers/visual_server.h index 3ed491d42..965f318f0 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -1032,6 +1032,7 @@ public: INFO_VERTICES_IN_FRAME, INFO_MATERIAL_CHANGES_IN_FRAME, INFO_SHADER_CHANGES_IN_FRAME, + INFO_SHADER_COMPILES_IN_FRAME, INFO_SURFACE_CHANGES_IN_FRAME, INFO_DRAW_CALLS_IN_FRAME, INFO_2D_ITEMS_IN_FRAME,