From f4b0654fcdb55e4cd2410022202f3dcbe257c234 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 24 Jul 2022 13:32:21 +0200 Subject: [PATCH] Allow setting plot color in the configuration message. --- public/client/TracyProfiler.hpp | 3 ++- public/common/TracyQueue.hpp | 1 + public/tracy/Tracy.hpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/client/TracyProfiler.hpp b/public/client/TracyProfiler.hpp index 4efb5811..bf478567 100644 --- a/public/client/TracyProfiler.hpp +++ b/public/client/TracyProfiler.hpp @@ -342,13 +342,14 @@ public: TracyLfqCommit; } - static tracy_force_inline void ConfigurePlot( const char* name, PlotFormatType type, bool step, bool fill ) + static tracy_force_inline void ConfigurePlot( const char* name, PlotFormatType type, bool step, bool fill, uint32_t color ) { TracyLfqPrepare( QueueType::PlotConfig ); MemWrite( &item->plotConfig.name, (uint64_t)name ); MemWrite( &item->plotConfig.type, (uint8_t)type ); MemWrite( &item->plotConfig.step, (uint8_t)step ); MemWrite( &item->plotConfig.fill, (uint8_t)fill ); + MemWrite( &item->plotConfig.color, color ); #ifdef TRACY_ON_DEMAND GetProfiler().DeferItem( *item ); diff --git a/public/common/TracyQueue.hpp b/public/common/TracyQueue.hpp index 7dae6284..9a4dfc80 100644 --- a/public/common/TracyQueue.hpp +++ b/public/common/TracyQueue.hpp @@ -610,6 +610,7 @@ struct QueuePlotConfig uint8_t type; uint8_t step; uint8_t fill; + uint32_t color; }; struct QueueParamSetup diff --git a/public/tracy/Tracy.hpp b/public/tracy/Tracy.hpp index 8a9c9cca..864b853e 100644 --- a/public/tracy/Tracy.hpp +++ b/public/tracy/Tracy.hpp @@ -47,7 +47,7 @@ #define LockableName(x,y,z); #define TracyPlot(x,y) -#define TracyPlotConfig(x,y,z,w) +#define TracyPlotConfig(x,y,z,w,a) #define TracyMessage(x,y) #define TracyMessageL(x) @@ -159,7 +159,7 @@ #define LockableName( varname, txt, size ) varname.CustomName( txt, size ) #define TracyPlot( name, val ) tracy::Profiler::PlotData( name, val ) -#define TracyPlotConfig( name, type, step, fill ) tracy::Profiler::ConfigurePlot( name, type, step, fill ) +#define TracyPlotConfig( name, type, step, fill, color ) tracy::Profiler::ConfigurePlot( name, type, step, fill, color ) #define TracyAppInfo( txt, size ) tracy::Profiler::MessageAppInfo( txt, size )