Skip to content

Commit

Permalink
moved rendering back to the main thread, avoiding excessive context s…
Browse files Browse the repository at this point in the history
…witching

removed offscreen fbo used for rendering the current frame
  • Loading branch information
inolen committed Jul 15, 2017
1 parent f0e44a2 commit 37bb113
Show file tree
Hide file tree
Showing 13 changed files with 274 additions and 506 deletions.
14 changes: 5 additions & 9 deletions src/core/profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,9 @@ prof_token_t prof_get_aggregate_token(const char *name) {
#endif
}

void prof_flip() {
/* flip frame-based profile zones at the end of every frame */
#if ENABLE_MICROPROFILE
MicroProfileFlip();
#endif
}

void prof_update(int64_t now) {
/* update time-based aggregate counters every second */
void prof_flip(int64_t now) {
#if ENABLE_MICROPROFILE
/* update time-based aggregate counters every second */
int64_t next_aggregation = prof.last_aggregation + NS_PER_SEC;

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

prof.last_aggregation = now;
}

/* flip frame-based profile zones at the end of every frame */
MicroProfileFlip();
#endif
}

Expand Down
6 changes: 1 addition & 5 deletions src/core/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ int64_t prof_counter_load(prof_token_t tok);
void prof_counter_add(prof_token_t tok, int64_t count);
void prof_counter_set(prof_token_t tok, int64_t count);

/* called periodically to aggregate time-based aggregate counters */
void prof_update(int64_t now);

/* called at the end of every frame to aggregate frame-based profile zones */
void prof_flip();
void prof_flip(int64_t now);

#endif
Loading

0 comments on commit 37bb113

Please sign in to comment.