Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
5037efde
Commit
5037efde
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Add some rendering statistics to profiler
parent
e9888c8e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/game.cpp
+1
-0
1 addition, 0 deletions
src/game.cpp
src/map.cpp
+14
-0
14 additions, 0 deletions
src/map.cpp
with
15 additions
and
0 deletions
src/game.cpp
+
1
−
0
View file @
5037efde
...
...
@@ -1071,6 +1071,7 @@ void the_game(
object_hit_delay_timer
-=
dtime
;
g_profiler
->
add
(
"Elapsed time"
,
dtime
);
g_profiler
->
avg
(
"FPS"
,
1.
/
dtime
);
/*
Log frametime for visualization
...
...
This diff is collapsed.
Click to expand it.
src/map.cpp
+
14
−
0
View file @
5037efde
...
...
@@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#endif
#include
"settings.h"
#include
"log.h"
#include
"profiler.h"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
...
...
@@ -3760,6 +3761,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
p_nodes_max
.
Z
/
MAP_BLOCKSIZE
+
1
);
u32
vertex_count
=
0
;
u32
meshbuffer_count
=
0
;
// For limiting number of mesh updates per frame
u32
mesh_update_count
=
0
;
...
...
@@ -3909,6 +3911,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
sector_blocks_drawn
++
;
u32
c
=
mesh
->
getMeshBufferCount
();
meshbuffer_count
+=
c
;
for
(
u32
i
=
0
;
i
<
c
;
i
++
)
{
...
...
@@ -3939,6 +3942,17 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
}
}
if
(
pass
==
scene
::
ESNRP_SOLID
){
g_profiler
->
avg
(
"CM: blocks drawn on solid pass"
,
blocks_drawn
);
g_profiler
->
avg
(
"CM: vertices drawn on solid pass"
,
vertex_count
);
if
(
blocks_drawn
!=
0
)
g_profiler
->
avg
(
"CM: solid meshbuffers per block"
,
(
float
)
meshbuffer_count
/
(
float
)
blocks_drawn
);
}
else
{
g_profiler
->
avg
(
"CM: blocks drawn on transparent pass"
,
blocks_drawn
);
g_profiler
->
avg
(
"CM: vertices drawn on transparent pass"
,
vertex_count
);
}
m_control
.
blocks_drawn
=
blocks_drawn
;
m_control
.
blocks_would_have_drawn
=
blocks_would_have_drawn
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment