Ticket #1862: ConventionFixV1.patch
File ConventionFixV1.patch, 4.7 KB (added by , 10 years ago) |
---|
-
binaries/data/config/default.cfg
328 328 ; > PROFILER 329 329 hotkey.profile.toggle = "F11" ; Enable/disable real-time profiler 330 330 hotkey.profile.save = "Shift+F11" ; Save current profiler data to logs/profile.txt 331 hotkey.profile2. enable = "F11" ; Enable HTTP/GPU modes for new profiler331 hotkey.profile2.toggle = "Ctrl+F11" ; Enable/disable HTTP/GPU modes for new profiler 332 332 333 profiler2. http.autoenable = false; Enable HTTP server output at startup (default off for security/performance)333 profiler2.autoenable = false ; Enable HTTP server output at startup (default off for security/performance) 334 334 profiler2.script.enable = false ; Enable Javascript profiling. Needs to be set before startup and can't be changed later. (default off for performance) 335 profiler2.gpu.autoenable = false ; Enable GPU timing at startup (default off for performance/compatibility)336 335 profiler2.gpu.arb.enable = true ; Allow GL_ARB_timer_query timing mode when available 337 336 profiler2.gpu.ext.enable = true ; Allow GL_EXT_timer_query timing mode when available 338 337 profiler2.gpu.intel.enable = true ; Allow GL_INTEL_performance_queries timing mode when available -
source/main.cpp
161 161 #endif 162 162 return IN_HANDLED; 163 163 } 164 else if (hotkey == "profile2. enable")164 else if (hotkey == "profile2.toggle") 165 165 { 166 g_Profiler2.EnableGPU(); 167 g_Profiler2.EnableHTTP(); 166 g_Profiler2.Toggle(); 168 167 return IN_HANDLED; 169 168 } 170 169 break; -
source/ps/GameSetup/GameSetup.cpp
955 955 // Optionally start profiler HTTP output automatically 956 956 // (By default it's only enabled by a hotkey, for security/performance) 957 957 bool profilerHTTPEnable = false; 958 CFG_GET_VAL("profiler2. http.autoenable", Bool, profilerHTTPEnable);958 CFG_GET_VAL("profiler2.autoenable", Bool, profilerHTTPEnable); 959 959 if (profilerHTTPEnable) 960 960 g_Profiler2.EnableHTTP(); 961 961 … … 992 992 // Optionally start profiler GPU timings automatically 993 993 // (By default it's only enabled by a hotkey, for performance/compatibility) 994 994 bool profilerGPUEnable = false; 995 CFG_GET_VAL("profiler2. gpu.autoenable", Bool, profilerGPUEnable);995 CFG_GET_VAL("profiler2.autoenable", Bool, profilerGPUEnable); 996 996 if (profilerGPUEnable) 997 997 g_Profiler2.EnableGPU(); 998 998 -
source/ps/Profiler2.cpp
1 /* Copyright (c) 201 1Wildfire Games1 /* Copyright (c) 2014 Wildfire Games 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 157 157 void CProfiler2::EnableHTTP() 158 158 { 159 159 ENSURE(m_Initialised); 160 LOGMESSAGERENDER(L"Starting profiler2 HTTP server"); 160 161 161 162 // Ignore multiple enablings 162 163 if (m_MgContext) … … 175 176 { 176 177 ENSURE(m_Initialised); 177 178 if (!m_GPU) 179 { 180 LOGMESSAGERENDER(L"Starting profiler2 GPU mode"); 178 181 InitialiseGPU(); 182 } 179 183 } 180 184 181 185 void CProfiler2::ShutdownGPU() 182 186 { 187 LOGMESSAGERENDER(L"Shutting down profiler2 GPU mode"); 183 188 SAFE_DELETE(m_GPU); 184 189 } 185 190 191 void CProfiler2::ShutDownHTTP() 192 { 193 LOGMESSAGERENDER(L"Shutting down profiler2 HTTP server"); 194 if (m_MgContext) 195 { 196 mg_stop(m_MgContext); 197 m_MgContext = NULL; 198 } 199 } 200 201 void CProfiler2::Toggle() 202 { 203 //TODO: Maybe we can open the browser to the profiler page automatically 204 if (m_GPU && m_MgContext) 205 { 206 ShutdownGPU(); 207 ShutDownHTTP(); 208 } 209 else if (!m_GPU && !m_MgContext) 210 { 211 EnableGPU(); 212 EnableHTTP(); 213 } 214 } 215 186 216 void CProfiler2::Shutdown() 187 217 { 188 218 ENSURE(m_Initialised); -
source/ps/Profiler2.h
276 276 void ShutdownGPU(); 277 277 278 278 /** 279 * Call in main thread to shut down the profiler's HTTP server 280 */ 281 void ShutDownHTTP(); 282 283 /** 284 * Call in main thread to enable/disable the profiler 285 */ 286 void Toggle(); 287 288 /** 279 289 * Call in main thread to shut everything down. 280 290 * All other profiled threads should have been terminated already. 281 291 */