From 849677ecf2c31fd401281bd35f4909a9dfaca329 Mon Sep 17 00:00:00 2001 From: Jm15itch <86093097+Jm15itch@users.noreply.github.com> Date: Wed, 12 Jul 2023 10:18:28 +0000 Subject: [PATCH] Fixed initalisation of globals polluting benchmarks The benchmarks were returning wrong numbers due to the first round of sampling requiring initialization of global/static variables in some functions. --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index 64615cc..9ba4100 100644 --- a/main.c +++ b/main.c @@ -1316,6 +1316,7 @@ void printAttrib(SDL_GLattr attr, char* name) // Returns the processing time. unsigned int BenchmarkFunction(void (*F)(), int samples) { + (*F)(); // Preempt the function to skip initializations unsigned int average = 0; for (int i = 0; i < samples; i++) {