diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 3801e42c7..aa432b8a3 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -5990,7 +5990,7 @@ bool handle_done_commit( steamcompmgr_win_t *w, xwayland_ctx_t *ctx, uint64_t co { gpuvis_trace_printf( "commit %lu done", w->commit_queue[ j ]->commitID ); static constinit char msg[12 + sizeof(uint64_t)+1]; - int msgSz = sprintf(msg, "commit %lu done\n", w->commit_queue[ j ]->commitID); + [[maybe_unused]] int msgSz = sprintf(msg, "commit %lu done\n", w->commit_queue[ j ]->commitID); TracyMessageC(msg, msgSz, TRACY_COLOR(LightSteelBlue)); w->commit_queue[ j ]->done = true; w->commit_queue[ j ]->earliest_present_time = earliestPresentTime; diff --git a/src/tracy_include.h b/src/tracy_include.h index e5a9ea94b..ea4b4014b 100644 --- a/src/tracy_include.h +++ b/src/tracy_include.h @@ -1,3 +1,8 @@ +#ifndef __TRACYAPI_H__ +# define __TRACYAPI_H__ +# define TRACY_API +#endif + #ifndef __TRACYSCOPED_GAMESCOPE__ #define __TRACYSCOPED_HPP__ #endif @@ -6,18 +11,40 @@ #include #include +#ifdef TracyIsStarted +# undef TracyIsStarted +#endif + #include "tracy/Tracy.hpp" #include "tracy/TracyC.h" // Hacky workaround for a compiler error that seems to happen when using tracy::ScopedZone::TextFmt // due to gcc being angry that a variadic function (the va_args kind) has the __attribute__((always_inline)) attribute on it -#ifndef __TRACYSCOPED_GAMESCOPE__ -#undef tracy_force_inline -#define tracy_force_inline inline -#undef __TRACYSCOPED_HPP__ -#include "client/TracyScoped.hpp" -#define __TRACYSCOPED_GAMESCOPE__ +#if !defined(__TRACYSCOPED_GAMESCOPE__) && defined(TRACY_ENABLE) +# ifdef tracy_force_inline +# undef tracy_force_inline +# endif + +# define tracy_force_inline inline +# define tracy_no_inline __attribute__((noinline)) +# define __TRACYFORCEINLINE_HPP__ +# undef __TRACYSCOPED_HPP__ + +# if !defined(TRACY_ENABLE) && defined(TracyIsStarted) +# undef TracyIsStarted +# endif + +# include "client/TracyScoped.hpp" +# if !defined(TRACY_ENABLE) && defined(TracyIsStarted) +# undef TracyIsStarted +# define TracyIsStarted false +# endif + +# undef tracy_force_inline +# define tracy_force_inline __attribute__((always_inline)) inline +# define __TRACYSCOPED_GAMESCOPE__ +# define __TRACYSCOPED_HPP__ #endif //************************************************************************// diff --git a/src/vblankmanager.cpp b/src/vblankmanager.cpp index 104cbc232..2c6201a9e 100644 --- a/src/vblankmanager.cpp +++ b/src/vblankmanager.cpp @@ -39,13 +39,13 @@ namespace gamescope // Majority of backends fall down this optimal // timerfd path, vs nudge thread. g_VBlankLog.infof( "Using timerfd." ); - static constexpr char msg[] = "Using timerfd."; + [[maybe_unused]] static constexpr char msg[] = "Using timerfd."; TracyAppInfo(const_cast(msg), sizeof(msg)); } else { g_VBlankLog.infof( "Using nudge thread." ); - static constexpr char msg[] = "Using nudge thread."; + [[maybe_unused]] static constexpr char msg[] = "Using nudge thread."; TracyAppInfo(const_cast(msg), sizeof(msg)); if ( pipe2( m_nNudgePipe, O_CLOEXEC | O_NONBLOCK ) != 0 ) diff --git a/src/vulkan_include.h b/src/vulkan_include.h index 534434a0d..df2499fdd 100644 --- a/src/vulkan_include.h +++ b/src/vulkan_include.h @@ -1,4 +1,8 @@ #pragma once +#ifndef __TRACYAPI_H__ +# define __TRACYAPI_H__ +# define TRACY_API +#endif #define VK_NO_PROTOTYPES #include @@ -11,7 +15,10 @@ # endif # define tracy_force_inline inline -# define tracy_no_inline __attribute__((noinline)) +# ifndef tracy_no_inline +# define tracy_no_inline __attribute__((noinline)) +# endif + # define __TRACYFORCEINLINE_HPP__ # include "client/TracyScoped.hpp" # undef tracy_force_inline