remove junk, fix warnings
This commit is contained in:
parent
ec602f2d70
commit
a124fa7ab2
|
@ -123,9 +123,9 @@ void APIENTRY glKosSwapBuffers() {
|
||||||
aligned_vector_clear(&PT_LIST.vector);
|
aligned_vector_clear(&PT_LIST.vector);
|
||||||
aligned_vector_clear(&TR_LIST.vector);
|
aligned_vector_clear(&TR_LIST.vector);
|
||||||
|
|
||||||
|
#ifdef PROFILER_COMPILE
|
||||||
PROFILER_CHECKPOINT("scene");
|
PROFILER_CHECKPOINT("scene");
|
||||||
PROFILER_POP();
|
PROFILER_POP();
|
||||||
#ifdef PROFILER_COMPILE
|
|
||||||
if(frame_count++ > 100) {
|
if(frame_count++ > 100) {
|
||||||
profiler_print_stats();
|
profiler_print_stats();
|
||||||
frame_count = 0;
|
frame_count = 0;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
static GLfloat SCENE_AMBIENT [] = {0.2, 0.2, 0.2, 1.0};
|
static GLfloat SCENE_AMBIENT [] = {0.2, 0.2, 0.2, 1.0};
|
||||||
static GLboolean VIEWER_IN_EYE_COORDINATES = GL_TRUE;
|
static GLboolean VIEWER_IN_EYE_COORDINATES = GL_TRUE;
|
||||||
static GLenum COLOR_CONTROL = GL_SINGLE_COLOR;
|
static GLenum COLOR_CONTROL = GL_SINGLE_COLOR;
|
||||||
static GLboolean TWO_SIDED_LIGHTING = GL_FALSE;
|
//static GLboolean TWO_SIDED_LIGHTING = GL_FALSE;
|
||||||
static GLenum COLOR_MATERIAL_MODE = GL_AMBIENT_AND_DIFFUSE;
|
static GLenum COLOR_MATERIAL_MODE = GL_AMBIENT_AND_DIFFUSE;
|
||||||
|
|
||||||
static LightSource LIGHTS[MAX_LIGHTS];
|
static LightSource LIGHTS[MAX_LIGHTS];
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include "profiler.h"
|
#include "profiler.h"
|
||||||
#include "../containers/aligned_vector.h"
|
#include "../containers/aligned_vector.h"
|
||||||
|
|
||||||
|
#ifdef PROFILER_COMPILE
|
||||||
|
|
||||||
#define MAX_PATH 256
|
#define MAX_PATH 256
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -126,7 +128,7 @@ void profiler_pop() {
|
||||||
|
|
||||||
aligned_vector_resize(&root->stack, root->stack.size - 1);
|
aligned_vector_resize(&root->stack, root->stack.size - 1);
|
||||||
}
|
}
|
||||||
|
#include <inttypes.h>
|
||||||
void profiler_print_stats() {
|
void profiler_print_stats() {
|
||||||
if(!PROFILER_ENABLED) return;
|
if(!PROFILER_ENABLED) return;
|
||||||
|
|
||||||
|
@ -138,6 +140,8 @@ void profiler_print_stats() {
|
||||||
float ms = ((float) result->total_time_us) / 1000.0f;
|
float ms = ((float) result->total_time_us) / 1000.0f;
|
||||||
float avg = ms / (float) result->total_calls;
|
float avg = ms / (float) result->total_calls;
|
||||||
|
|
||||||
fprintf(stderr, "%-60s%-20f%-20f%u\n", result->name, avg, ms, result->total_calls);
|
fprintf(stderr, "%-60s%-20f%-20f%" PRIu64 "\n", result->name, (double)avg, (double)ms, result->total_calls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define PROFILER_COMPILE 0
|
||||||
|
#ifdef PROFILER_COMPILE
|
||||||
|
#define PROFILER_PUSH(S) profiler_push(S)
|
||||||
|
#define PROFILER_CHECKPOINT(P) profiler_checkpoint(P)
|
||||||
|
#define PROFILER_POP() profiler_pop()
|
||||||
|
void profiler_enable();
|
||||||
|
void profiler_disable();
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char name[64];
|
char name[64];
|
||||||
uint64_t start_time_in_us;
|
uint64_t start_time_in_us;
|
||||||
|
@ -13,15 +21,6 @@ void profiler_checkpoint(const char* name);
|
||||||
void profiler_pop();
|
void profiler_pop();
|
||||||
|
|
||||||
void profiler_print_stats();
|
void profiler_print_stats();
|
||||||
|
|
||||||
void profiler_enable();
|
|
||||||
void profiler_disable();
|
|
||||||
|
|
||||||
#define PROFILER_COMPILE 0
|
|
||||||
#ifdef PROFILER_COMPILE
|
|
||||||
#define PROFILER_PUSH(S) profiler_push(S)
|
|
||||||
#define PROFILER_CHECKPOINT(P) profiler_checkpoint(P)
|
|
||||||
#define PROFILER_POP() profiler_pop()
|
|
||||||
#else
|
#else
|
||||||
#define PROFILER_PUSH(S) do {} while (0)
|
#define PROFILER_PUSH(S) do {} while (0)
|
||||||
#define PROFILER_CHECKPOINT(P) do {} while (0)
|
#define PROFILER_CHECKPOINT(P) do {} while (0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user