diff --git a/CMakePresets.json b/CMakePresets.json index 228711f3fdd..9fa7a056ba4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -77,8 +77,7 @@ "cacheVariables": { "CMAKE_EXPORT_COMPILE_COMMANDS": true, "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}", - "CMAKE_BUILD_TYPE": "Debug", - "PROFILER_ENABLED": "1" + "CMAKE_BUILD_TYPE": "Debug" }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -138,8 +137,7 @@ "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}", "CMAKE_BUILD_TYPE": "Debug", "CMAKE_C_COMPILER": "/usr/bin/clang", - "CMAKE_CXX_COMPILER": "/usr/bin/clang++", - "PROFILER_ENABLED": "1" + "CMAKE_CXX_COMPILER": "/usr/bin/clang++" }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { diff --git a/contrib/profiler/Profiler.cpp b/contrib/profiler/Profiler.cpp index 6ec3f9c499a..0be8f50dccd 100644 --- a/contrib/profiler/Profiler.cpp +++ b/contrib/profiler/Profiler.cpp @@ -25,7 +25,6 @@ #include "Profiler.h" #if defined(USE_CHRONO) -#undef __PROFILER_SMP__ #include #endif @@ -115,7 +114,7 @@ namespace Profiler { #if !defined(USE_CHRONO) volatile u32 mLock; #else - std::atomic_uint32_t mLock; + std::atomic_uint32_t mLock = { 0 }; #endif }; #else @@ -915,7 +914,7 @@ namespace Profiler { #if defined(__PROFILER_ENABLED__) - threadlocal Caller::ThreadState Caller::thisThread = { {0}, 0, 0, 0, 0 }; + threadlocal Caller::ThreadState Caller::thisThread = { {}, 0, 0, 0, 0 }; f64 Caller::mTimerOverhead = 0, Caller::mRdtscOverhead = 0; u64 Caller::mGlobalDuration = 0; Caller::Max Caller::maxStats; @@ -999,7 +998,7 @@ namespace Profiler { u64 globalStart = Timer::getticks(); u64 globalClockStart = Clock::getticks(); - GlobalThreadList threads = { NULL, {0} }; + GlobalThreadList threads = { NULL, {} }; threadlocal Caller *root = NULL; diff --git a/src/Frame.cpp b/src/Frame.cpp index 7abeb275e29..1c2169d87f0 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -305,7 +305,8 @@ void Frame::CollideFrames(void (*callback)(CollisionContact *)) if (!frame.m_collisionSpace) continue; - PROFILE_SCOPED_DESC(frame.m_label.c_str()) + // Used to be frame.m_label.c_str() however the preprocessor is evaluated at compile time this fails on MSVC + PROFILE_SCOPED_DESC("Loop frame") frame.m_collisionSpace->Collide(callback); } }