Add optional dcprof to prof_texture_upload

This commit is contained in:
Luke Benstead 2023-09-01 20:22:19 +01:00
parent cfbaea4a46
commit 246cb997da
2 changed files with 19 additions and 2 deletions

View File

@ -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()

View File

@ -4,6 +4,7 @@
#ifdef __DREAMCAST__
#include <kos.h>
#include "../profiler.h"
#endif
#include <GL/gl.h>
@ -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;