1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Configure number of threads in TimelineController.

This commit is contained in:
Bartosz Taudul 2023-05-01 14:41:51 +02:00
parent a2d470690f
commit 331c2bd7c0
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@
namespace tracy
{
TimelineController::TimelineController( View& view, Worker& worker )
TimelineController::TimelineController( View& view, Worker& worker, bool threading )
: m_height( 0 )
, m_scroll( 0 )
, m_centerItemkey( nullptr )
@ -20,7 +20,7 @@ TimelineController::TimelineController( View& view, Worker& worker )
#ifdef __EMSCRIPTEN__
, m_td( 1 )
#else
, m_td( std::max( 1u, std::thread::hardware_concurrency() - 2 ), "Render" )
, m_td( threading ? std::max( 1u, std::thread::hardware_concurrency() - 2 ) : 1, "Render" )
#endif
{
}

View File

@ -20,7 +20,7 @@ class Worker;
class TimelineController
{
public:
TimelineController( View& view, Worker& worker );
TimelineController( View& view, Worker& worker, bool threading );
~TimelineController();
void FirstFrameExpired();

View File

@ -50,7 +50,7 @@ View::View( void(*cbMainThread)(const std::function<void()>&, bool), const char*
, m_viewMode( ViewMode::LastFrames )
, m_viewModeHeuristicTry( true )
, m_forceConnectionPopup( true, true )
, m_tc( *this, m_worker )
, m_tc( *this, m_worker, config.threadedRendering )
, m_frames( nullptr )
, m_messagesScrollBottom( true )
, m_reactToCrash( true )
@ -73,7 +73,7 @@ View::View( void(*cbMainThread)(const std::function<void()>&, bool), FileRead& f
, m_filename( f.GetFilename() )
, m_staticView( true )
, m_viewMode( ViewMode::Paused )
, m_tc( *this, m_worker )
, m_tc( *this, m_worker, config.threadedRendering )
, m_frames( m_worker.GetFramesBase() )
, m_messagesScrollBottom( false )
, m_smallFont( smallFont )