Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux de-profile and msvc compilation fix #5967

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
7 changes: 3 additions & 4 deletions contrib/profiler/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "Profiler.h"

#if defined(USE_CHRONO)
#undef __PROFILER_SMP__
#include <atomic>
#endif

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;


Expand Down
3 changes: 2 additions & 1 deletion src/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down