Reenable TracyDebug LogString except under TRACY_DELAYED_INIT and not TRACY_MANUAL_LIFETIME

This commit is contained in:
Clément Grégoire
2026-02-01 14:50:37 +01:00
parent bc122d5c3d
commit 55ce01c69e
+6
View File
@@ -18,6 +18,12 @@
#ifdef TRACY_VERBOSE
# include <stdio.h>
# define TracyDebug(...) do { fprintf( stderr, __VA_ARGS__ ); fputc( '\n', stderr ); } while( 0 )
// Note: We can't use LogString when using TRACY_DELAYED_INIT due to a deadlock in the init code.
// This is caused by `GetProfilerData` triggerting ProfileData ctor, which itself will call `GetProfilerData` and deadlock.
// TRACY_MANUAL_LIFETIME does not have this issue since StartupProfiler sets s_profilerData before calling the constructor.
// In general, this also means we can only call TracyDebug after and the first logging is after queue initialization and critical init (such as InitCallstackCritical).
#elif !defined(TRACY_NO_INTERNAL_MESSAGE) && (!defined(TRACY_DELAYED_INIT) || defined(TRACY_MANUAL_LIFETIME))
# define TracyDebug(...) TracyInternalMessage( tracy::MessageSeverity::Debug, __VA_ARGS__ )
#else
# define TracyDebug(...)
#endif