Skip to content

Commit 37bb113

Browse files
committed
moved rendering back to the main thread, avoiding excessive context switching
removed offscreen fbo used for rendering the current frame
1 parent f0e44a2 commit 37bb113

13 files changed

Lines changed: 274 additions & 506 deletions

File tree

src/core/profiler.cc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,9 @@ prof_token_t prof_get_aggregate_token(const char *name) {
111111
#endif
112112
}
113113

114-
void prof_flip() {
115-
/* flip frame-based profile zones at the end of every frame */
116-
#if ENABLE_MICROPROFILE
117-
MicroProfileFlip();
118-
#endif
119-
}
120-
121-
void prof_update(int64_t now) {
122-
/* update time-based aggregate counters every second */
114+
void prof_flip(int64_t now) {
123115
#if ENABLE_MICROPROFILE
116+
/* update time-based aggregate counters every second */
124117
int64_t next_aggregation = prof.last_aggregation + NS_PER_SEC;
125118

126119
if (now > next_aggregation) {
@@ -135,6 +128,9 @@ void prof_update(int64_t now) {
135128

136129
prof.last_aggregation = now;
137130
}
131+
132+
/* flip frame-based profile zones at the end of every frame */
133+
MicroProfileFlip();
138134
#endif
139135
}
140136

src/core/profiler.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ int64_t prof_counter_load(prof_token_t tok);
4747
void prof_counter_add(prof_token_t tok, int64_t count);
4848
void prof_counter_set(prof_token_t tok, int64_t count);
4949

50-
/* called periodically to aggregate time-based aggregate counters */
51-
void prof_update(int64_t now);
52-
53-
/* called at the end of every frame to aggregate frame-based profile zones */
54-
void prof_flip();
50+
void prof_flip(int64_t now);
5551

5652
#endif

0 commit comments

Comments
 (0)