Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-09-28 02:31:38 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-09-28 02:31:38 +0300
commitb24506492afa0bba14c593c50d0257afcd1eb8f0 (patch)
tree55d610c8f308a4b86d0174d8da0505628c865ae8 /profiler/src
parentf5abdd489dc4617277f7ac639b97411d9813af4f (diff)
Move client broadcasts processing earlier in code.
Diffstat (limited to 'profiler/src')
-rw-r--r--profiler/src/main.cpp104
1 files changed, 54 insertions, 50 deletions
diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp
index a7229113..7a9dc4d1 100644
--- a/profiler/src/main.cpp
+++ b/profiler/src/main.cpp
@@ -267,57 +267,8 @@ static void DrawContents()
static uint16_t reconnectPort;
static bool showFilter = false;
- int display_w, display_h;
- bptr->NewFrame( display_w, display_h );
-
- static int activeFrames = 3;
- if( tracy::WasActive() || ( view && view->WasActive() ) )
- {
- activeFrames = 3;
- }
- else
- {
- auto ctx = ImGui::GetCurrentContext();
- if( ctx->DimBgRatio != 0 && ctx->DimBgRatio != 1 )
- {
- activeFrames = 3;
- }
- else
- {
- auto& inputQueue = ctx->InputEventsQueue;
- if( !inputQueue.empty() )
- {
- for( auto& v : inputQueue )
- {
- if( v.Type != ImGuiInputEventType_MouseViewport )
- {
- activeFrames = 3;
- break;
- }
- }
- }
- }
- }
- if( activeFrames == 0 )
- {
- std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) );
- return;
- }
- activeFrames--;
-
- ImGui::NewFrame();
- tracy::MouseFrame();
-
- setlocale( LC_NUMERIC, "C" );
-
if( !view )
{
- if( s_customTitle )
- {
- s_customTitle = false;
- bptr->SetTitle( title );
- }
-
const auto time = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
if( !broadcastListen )
{
@@ -398,6 +349,58 @@ static void DrawContents()
}
}
}
+ }
+
+ int display_w, display_h;
+ bptr->NewFrame( display_w, display_h );
+
+ static int activeFrames = 3;
+ if( tracy::WasActive() || ( view && view->WasActive() ) )
+ {
+ activeFrames = 3;
+ }
+ else
+ {
+ auto ctx = ImGui::GetCurrentContext();
+ if( ctx->DimBgRatio != 0 && ctx->DimBgRatio != 1 )
+ {
+ activeFrames = 3;
+ }
+ else
+ {
+ auto& inputQueue = ctx->InputEventsQueue;
+ if( !inputQueue.empty() )
+ {
+ for( auto& v : inputQueue )
+ {
+ if( v.Type != ImGuiInputEventType_MouseViewport )
+ {
+ activeFrames = 3;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if( activeFrames == 0 )
+ {
+ std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) );
+ return;
+ }
+ activeFrames--;
+
+ ImGui::NewFrame();
+ tracy::MouseFrame();
+
+ setlocale( LC_NUMERIC, "C" );
+
+ if( !view )
+ {
+ if( s_customTitle )
+ {
+ s_customTitle = false;
+ bptr->SetTitle( title );
+ }
auto& style = ImGui::GetStyle();
style.Colors[ImGuiCol_WindowBg] = ImVec4( 0.129f, 0.137f, 0.11f, 1.f );
@@ -656,9 +659,10 @@ static void DrawContents()
ImGui::SetColumnWidth( 1, w * 0.175f );
ImGui::SetColumnWidth( 2, w * 0.425f );
}
- std::lock_guard<std::mutex> lock( resolvLock );
+ const auto time = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
int idx = 0;
int passed = 0;
+ std::lock_guard<std::mutex> lock( resolvLock );
for( auto& v : clients )
{
const bool badProto = v.second.protocolVersion != tracy::ProtocolVersion;