diff --git a/CMakeLists.txt b/CMakeLists.txt index c148059..51ad8ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,11 +210,11 @@ gen_sample(polymark samples/polymark/main.c) gen_sample(cubes samples/cubes/main.cpp) gen_sample(zclip_test tests/zclip/main.cpp) -gen_sample(prof_texture_upload samples/prof_texture_upload/main.c) - if(PLATFORM_DREAMCAST) gen_sample(trimark samples/trimark/main.c) gen_sample(quadmark samples/quadmark/main.c samples/profiler.c) + gen_sample(prof_texture_upload samples/prof_texture_upload/main.c samples/profiler.c) else() gen_sample(quadmark samples/quadmark/main.c) + gen_sample(prof_texture_upload samples/prof_texture_upload/main.c) endif() diff --git a/samples/prof_texture_upload/main.c b/samples/prof_texture_upload/main.c index d2fd12f..4981679 100644 --- a/samples/prof_texture_upload/main.c +++ b/samples/prof_texture_upload/main.c @@ -4,6 +4,7 @@ #ifdef __DREAMCAST__ #include +#include "../profiler.h" #endif #include @@ -11,11 +12,13 @@ #include "image.h" +#define PROFILE 0 int main(int argc, char* argv[]) { (void) argc; (void) argv; + fprintf(stdout, "Initializing\n"); glKosInit(); glClearColor(0.5f, 0.0f, 0.5f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -32,6 +35,13 @@ int main(int argc, char* argv[]) { fprintf(stderr, "Starting test run...\n"); +#ifdef __DREAMCAST__ +#if PROFILE + profiler_init("/pc/gmon.out"); + profiler_start(); +#endif +#endif + while((end - start) < 5) { glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, header_data @@ -41,6 +51,13 @@ int main(int argc, char* argv[]) { end = time(NULL); } +#ifdef __DREAMCAST__ +#if PROFILE + profiler_stop(); + profiler_clean_up(); +#endif +#endif + fprintf(stderr, "Called glTexImage2D %d times (%.4f per call)\n", counter, (float)(end - start) / (float)(counter)); return 0;