From 8dd59d07ac0656d72612b0d70f35b9712eb3ee6b Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 29 Aug 2015 09:41:14 -0700 Subject: [PATCH] Was about to update microprofile, but the new version is meh. --- premake5.lua | 1 - src/xenia/profiling.cc | 1 + src/xenia/profiling.h | 1 + src/xenia/ui/gl/gl_profiler_display.cc | 32 +++++++++++++------------- third_party/microprofile/README.md | 15 +++++++++++- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/premake5.lua b/premake5.lua index e491a6dd3..75999667d 100644 --- a/premake5.lua +++ b/premake5.lua @@ -14,7 +14,6 @@ includedirs({ defines({ "_UNICODE", "UNICODE", - "MICROPROFILE_MAX_THREADS=128", }) vectorextensions("AVX") diff --git a/src/xenia/profiling.cc b/src/xenia/profiling.cc index b0c99ddd4..0b35d6f2d 100644 --- a/src/xenia/profiling.cc +++ b/src/xenia/profiling.cc @@ -26,6 +26,7 @@ #define MICROPROFILE_PRINTF XELOGI #define MICROPROFILE_WEBSERVER 0 #define MICROPROFILE_DEBUG 0 +#define MICROPROFILE_MAX_THREADS 128 #include "third_party/microprofile/microprofile.h" #include "xenia/profiling.h" diff --git a/src/xenia/profiling.h b/src/xenia/profiling.h index a655af154..5dac7ea76 100644 --- a/src/xenia/profiling.h +++ b/src/xenia/profiling.h @@ -23,6 +23,7 @@ #if XE_OPTION_PROFILING // Pollutes the global namespace. Yuck. +#define MICROPROFILE_MAX_THREADS 128 #include #endif // XE_OPTION_PROFILING diff --git a/src/xenia/ui/gl/gl_profiler_display.cc b/src/xenia/ui/gl/gl_profiler_display.cc index 870172300..04903df20 100644 --- a/src/xenia/ui/gl/gl_profiler_display.cc +++ b/src/xenia/ui/gl/gl_profiler_display.cc @@ -443,23 +443,23 @@ void GLProfilerDisplay::DrawBox(int x0, int y0, int x1, int y1, uint32_t color, if (type == BoxType::kFlat) { color = ((color & 0xff) << 16) | ((color >> 16) & 0xff) | (0xff00ff00 & color); - Q0(v, x, x0); - Q0(v, y, y0); + Q0(v, x, static_cast(x0)); + Q0(v, y, static_cast(y0)); Q0(v, color, color); Q0(v, u, 2.0f); Q0(v, v, 2.0f); - Q1(v, x, x1); - Q1(v, y, y0); + Q1(v, x, static_cast(x1)); + Q1(v, y, static_cast(y0)); Q1(v, color, color); Q1(v, u, 2.0f); Q1(v, v, 2.0f); - Q2(v, x, x1); - Q2(v, y, y1); + Q2(v, x, static_cast(x1)); + Q2(v, y, static_cast(y1)); Q2(v, color, color); Q2(v, u, 2.0f); Q2(v, v, 2.0f); - Q3(v, x, x0); - Q3(v, y, y1); + Q3(v, x, static_cast(x0)); + Q3(v, y, static_cast(y1)); Q3(v, color, color); Q3(v, u, 2.0f); Q3(v, v, 2.0f); @@ -479,23 +479,23 @@ void GLProfilerDisplay::DrawBox(int x0, int y0, int x1, int y1, uint32_t color, uint32_t b1 = 0xff & ((b + nMin) / 2); uint32_t color0 = (r0 << 0) | (g0 << 8) | (b0 << 16) | (0xff000000 & color); uint32_t color1 = (r1 << 0) | (g1 << 8) | (b1 << 16) | (0xff000000 & color); - Q0(v, x, x0); - Q0(v, y, y0); + Q0(v, x, static_cast(x0)); + Q0(v, y, static_cast(y0)); Q0(v, color, color0); Q0(v, u, 2.0f); Q0(v, v, 2.0f); - Q1(v, x, x1); - Q1(v, y, y0); + Q1(v, x, static_cast(x1)); + Q1(v, y, static_cast(y0)); Q1(v, color, color0); Q1(v, u, 3.0f); Q1(v, v, 2.0f); - Q2(v, x, x1); - Q2(v, y, y1); + Q2(v, x, static_cast(x1)); + Q2(v, y, static_cast(y1)); Q2(v, color, color1); Q2(v, u, 3.0f); Q2(v, v, 3.0f); - Q3(v, x, x0); - Q3(v, y, y1); + Q3(v, x, static_cast(x0)); + Q3(v, y, static_cast(y1)); Q3(v, color, color1); Q3(v, u, 2.0f); Q3(v, v, 3.0f); diff --git a/third_party/microprofile/README.md b/third_party/microprofile/README.md index 8b8040b20..aaedb9b12 100644 --- a/third_party/microprofile/README.md +++ b/third_party/microprofile/README.md @@ -1 +1,14 @@ -https://bitbucket.org/jonasmeyer/microprofile +# microprofile + +MicroProfile is a embeddable profiler in a single file, written in C++ + +It can display profile information in the application, or by generating captures via a minimal built in webserver. + +# Dependencies +Microprofile supports generating compressed captures using miniz(http:/code.google.com/miniz). + +# License +Licensed using unlicense.org + +# Screenshot +![Microprofile in action](https://pbs.twimg.com/media/BnvzublCEAA0Mqf.png:large)