summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_storage_gles2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2/rasterizer_storage_gles2.cpp')
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp58
1 files changed, 56 insertions, 2 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 92a4c2a3b4..01d5e35e56 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -5208,18 +5208,72 @@ void RasterizerStorageGLES2::set_debug_generate_wireframes(bool p_generate) {
}
void RasterizerStorageGLES2::render_info_begin_capture() {
+
+ info.snap = info.render;
}
void RasterizerStorageGLES2::render_info_end_capture() {
+
+ info.snap.object_count = info.render.object_count - info.snap.object_count;
+ info.snap.draw_call_count = info.render.draw_call_count - info.snap.draw_call_count;
+ info.snap.material_switch_count = info.render.material_switch_count - info.snap.material_switch_count;
+ info.snap.surface_switch_count = info.render.surface_switch_count - info.snap.surface_switch_count;
+ info.snap.shader_rebind_count = info.render.shader_rebind_count - info.snap.shader_rebind_count;
+ info.snap.vertices_count = info.render.vertices_count - info.snap.vertices_count;
}
int RasterizerStorageGLES2::get_captured_render_info(VS::RenderInfo p_info) {
- return get_render_info(p_info);
+ switch (p_info) {
+ case VS::INFO_OBJECTS_IN_FRAME: {
+ return info.snap.object_count;
+ } break;
+ case VS::INFO_VERTICES_IN_FRAME: {
+ return info.snap.vertices_count;
+ } break;
+ case VS::INFO_MATERIAL_CHANGES_IN_FRAME: {
+ return info.snap.material_switch_count;
+ } break;
+ case VS::INFO_SHADER_CHANGES_IN_FRAME: {
+ return info.snap.shader_rebind_count;
+ } break;
+ case VS::INFO_SURFACE_CHANGES_IN_FRAME: {
+ return info.snap.surface_switch_count;
+ } break;
+ case VS::INFO_DRAW_CALLS_IN_FRAME: {
+ return info.snap.draw_call_count;
+ } break;
+ default: {
+ return get_render_info(p_info);
+ }
+ }
}
int RasterizerStorageGLES2::get_render_info(VS::RenderInfo p_info) {
- return 0;
+ switch (p_info) {
+ case VS::INFO_OBJECTS_IN_FRAME:
+ return info.render_final.object_count;
+ case VS::INFO_VERTICES_IN_FRAME:
+ return info.render_final.vertices_count;
+ case VS::INFO_MATERIAL_CHANGES_IN_FRAME:
+ return info.render_final.material_switch_count;
+ case VS::INFO_SHADER_CHANGES_IN_FRAME:
+ return info.render_final.shader_rebind_count;
+ case VS::INFO_SURFACE_CHANGES_IN_FRAME:
+ return info.render_final.surface_switch_count;
+ case VS::INFO_DRAW_CALLS_IN_FRAME:
+ return info.render_final.draw_call_count;
+ case VS::INFO_USAGE_VIDEO_MEM_TOTAL:
+ return 0; //no idea
+ case VS::INFO_VIDEO_MEM_USED:
+ return info.vertex_mem + info.texture_mem;
+ case VS::INFO_TEXTURE_MEM_USED:
+ return info.texture_mem;
+ case VS::INFO_VERTEX_MEM_USED:
+ return info.vertex_mem;
+ default:
+ return 0; //no idea either
+ }
}
void RasterizerStorageGLES2::initialize() {