From e41ae15f27edfc9bb69d6d9f48b079db82850b5c Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Fri, 20 Feb 2026 09:08:21 -0800 Subject: [PATCH 1/7] using ARM64 intrinsics on Windows on ARM --- public/client/TracyProfiler.cpp | 7 +++++++ public/client/TracyProfiler.hpp | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp index deedf4c6..5ff3abd1 100644 --- a/public/client/TracyProfiler.cpp +++ b/public/client/TracyProfiler.cpp @@ -282,6 +282,13 @@ static bool EnsureReadable( uintptr_t address ) return mapping && EnsureReadable( *mapping ); } #elif defined WIN32 +#if defined TRACY_HAS_CNTVCT +tracy_force_inline int64_t timestamp_win_arm64_cntvct_el0() +{ + return _ReadStatusReg( ARM64_CNTVCT_EL0 ); +} +#endif + static bool EnsureReadable( uintptr_t address ) { MEMORY_BASIC_INFORMATION memInfo; diff --git a/public/client/TracyProfiler.hpp b/public/client/TracyProfiler.hpp index 7ddd244a..2bce0237 100644 --- a/public/client/TracyProfiler.hpp +++ b/public/client/TracyProfiler.hpp @@ -30,6 +30,8 @@ #if ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) # define TRACY_HAS_RDTSC +#elif defined _WIN32 && defined _M_ARM64 +# define TRACY_HAS_CNTVCT #elif defined __APPLE__ && defined __MACH__ && TARGET_CPU_ARM64 // For now only supported on Apple devices # define TRACY_HAS_CNTVCT #endif @@ -171,6 +173,11 @@ struct LuaZoneState typedef void(*ParameterCallback)( void* data, uint32_t idx, int32_t val ); typedef char*(*SourceContentsCallback)( void* data, const char* filename, size_t& size ); +#if defined _WIN32 && defined TRACY_HAS_CNTVCT +// NOTE: implementation requires including windows.h +tracy_force_inline int64_t timestamp_win_arm64_cntvct_el0(); +#endif + class Profiler { struct FrameImageQueueItem @@ -226,7 +233,9 @@ public: # elif defined _WIN32 # ifdef TRACY_TIMER_QPC return GetTimeQpc(); -# else +# elif defined TRACY_HAS_CNTVCT + return timestamp_win_arm64_cntvct_el0(); +# elif defined TRACY_HAS_RDTSC if( HardwareSupportsInvariantTSC() ) return int64_t( __rdtsc() ); # endif # elif defined __i386 || defined _M_IX86 From 960911f263cc97f9a18235be37cc8a1b82744b48 Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Fri, 20 Feb 2026 09:23:36 -0800 Subject: [PATCH 2/7] update manual with remarks about Windows on ARM --- manual/tracy.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manual/tracy.tex b/manual/tracy.tex index 00c95889..d27d1484 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -876,6 +876,12 @@ logo=\bcbombe Please don't ask about window decorations in Gnome. The current behavior is the intended behavior. Gnome does not want windows to have decorations, and Tracy respects that choice. If you find this problematic, use a desktop environment that actually listens to its users. \end{bclogo} +\subsubsection{Windows on ARM} + +Special considerations must be taken to run the Tracy server/profiler GUI on Windows on ARM. + +Ensure that the "OpenCL, OpenGL, and Vulkan Compatibility Pack" is installed (from the Microsoft Store), otherwise the GUI will not open. + \subsubsection{Using an IDE} The recommended development environment is Visual Studio Code\footnote{\url{https://code.visualstudio.com/}}. This is a cross-platform solution, so you always get the same experience, no matter what OS you are using. From 0f170f51c6690a91b4214bb02c31004a2e5cf9a8 Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Fri, 20 Feb 2026 09:33:37 -0800 Subject: [PATCH 3/7] report GUI initialization error before terminating --- profiler/src/BackendGlfw.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/profiler/src/BackendGlfw.cpp b/profiler/src/BackendGlfw.cpp index 82eb5ed0..68cb632c 100644 --- a/profiler/src/BackendGlfw.cpp +++ b/profiler/src/BackendGlfw.cpp @@ -134,7 +134,18 @@ Backend::Backend( const char* title, const std::function& redraw, const # endif #endif s_window = glfwCreateWindow( m_winPos.w, m_winPos.h, title, NULL, NULL ); - if( !s_window ) exit( 1 ); + if( !s_window ) { + const char* description; + int code = glfwGetError( &description ); + if( description ) { + fprintf( stderr, "ERROR: Tracy (GLFW): %s\n", description ); +# ifdef _WIN32 + MessageBoxA( NULL, description, "ERROR: Tracy (GLFW)", MB_OK ); + OutputDebugStringA( description ); +# endif + } + exit( 1 ); + } glfwSetWindowPos( s_window, m_winPos.x, m_winPos.y ); #if GLFW_VERSION_MAJOR > 3 || ( GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 2 ) From 83707a9c2fc21a85d343a288f88c99a18419d1f8 Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Fri, 20 Feb 2026 11:05:28 -0800 Subject: [PATCH 4/7] updated support list --- manual/tracy.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/tracy.tex b/manual/tracy.tex index d27d1484..1567eb04 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -368,7 +368,7 @@ Note that these binary releases require AVX2 instruction set support on the proc Tracy Profiler supports MSVC, GCC, and clang. You will need to use a reasonably recent version of the compiler due to the C++11 requirement. The following platforms are confirmed to be working (this is not a complete list): \begin{itemize} -\item Windows (x86, x64, ARM64) +\item Windows (x86, x64, ARM64\footnote{\url{Requires \textbf{"OpenCL, OpenGL, and Vulkan Compatibility Pack"} from Microsoft Store}}.) \item Linux (x86, x64, ARM, ARM64) \item Android (ARM, ARM64, x86) \item FreeBSD (x64) @@ -880,7 +880,7 @@ Please don't ask about window decorations in Gnome. The current behavior is the Special considerations must be taken to run the Tracy server/profiler GUI on Windows on ARM. -Ensure that the "OpenCL, OpenGL, and Vulkan Compatibility Pack" is installed (from the Microsoft Store), otherwise the GUI will not open. +Ensure that the \textbf{"OpenCL, OpenGL, and Vulkan Compatibility Pack"} is installed (from the Microsoft Store), otherwise the GUI will fail to open. \subsubsection{Using an IDE} From 42b0512517e14896d0937d95d80c1a901ba99d3f Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Fri, 20 Feb 2026 12:29:39 -0800 Subject: [PATCH 5/7] fix copy-pasta... --- manual/tracy.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/tracy.tex b/manual/tracy.tex index 1567eb04..5a864a8a 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -368,7 +368,7 @@ Note that these binary releases require AVX2 instruction set support on the proc Tracy Profiler supports MSVC, GCC, and clang. You will need to use a reasonably recent version of the compiler due to the C++11 requirement. The following platforms are confirmed to be working (this is not a complete list): \begin{itemize} -\item Windows (x86, x64, ARM64\footnote{\url{Requires \textbf{"OpenCL, OpenGL, and Vulkan Compatibility Pack"} from Microsoft Store}}.) +\item Windows (x86, x64, ARM64\footnote{Requires \textbf{"OpenCL, OpenGL, and Vulkan Compatibility Pack"} from Microsoft Store.}) \item Linux (x86, x64, ARM, ARM64) \item Android (ARM, ARM64, x86) \item FreeBSD (x64) From 93036b68770ac935b7d2ab1e5249f7ca7885b57d Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Sun, 1 Mar 2026 08:14:10 -0800 Subject: [PATCH 6/7] code review: implement in header, but don't bring windows.h along for the ride --- public/client/TracyProfiler.cpp | 8 +------- public/client/TracyProfiler.hpp | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp index 5ff3abd1..4be292a0 100644 --- a/public/client/TracyProfiler.cpp +++ b/public/client/TracyProfiler.cpp @@ -282,13 +282,7 @@ static bool EnsureReadable( uintptr_t address ) return mapping && EnsureReadable( *mapping ); } #elif defined WIN32 -#if defined TRACY_HAS_CNTVCT -tracy_force_inline int64_t timestamp_win_arm64_cntvct_el0() -{ - return _ReadStatusReg( ARM64_CNTVCT_EL0 ); -} -#endif - +static_assert( TRACY_WINARM64_CNTVCT_EL0 == ARM64_CNTVCT_EL0, "ARM64_CNTVCT_EL0 mismatch" ); static bool EnsureReadable( uintptr_t address ) { MEMORY_BASIC_INFORMATION memInfo; diff --git a/public/client/TracyProfiler.hpp b/public/client/TracyProfiler.hpp index 2bce0237..6c2b564f 100644 --- a/public/client/TracyProfiler.hpp +++ b/public/client/TracyProfiler.hpp @@ -174,8 +174,24 @@ typedef void(*ParameterCallback)( void* data, uint32_t idx, int32_t val ); typedef char*(*SourceContentsCallback)( void* data, const char* filename, size_t& size ); #if defined _WIN32 && defined TRACY_HAS_CNTVCT -// NOTE: implementation requires including windows.h -tracy_force_inline int64_t timestamp_win_arm64_cntvct_el0(); +// NOTE: implementing timestamp_win_arm64_cntvct_el0() requires ARM64_CNTVCT_EL0, +// which in turn would require including "Windows.h" here... instead, just bring +// what's needed from "winnt.h" +# ifdef ARM64_CNTVCT_EL0 +# define TRACY_WINARM64_CNTVCT_EL0 ARM64_CNTVCT_EL0 +# else +# define TRACY_WINARM64_SYSREG( op0, op1, crn, crm, op2 ) \ + ( ( ( op0 & 1 ) << 14 ) | \ + ( ( op1 & 7 ) << 11 ) | \ + ( ( crn & 15 ) << 7 ) | \ + ( ( crm & 15 ) << 3 ) | \ + ( ( op2 & 7 ) << 0 ) ) +# define TRACY_WINARM64_CNTVCT_EL0 TRACY_WINARM64_SYSREG( 3, 3, 14, 0, 2 ) +# endif +tracy_force_inline int64_t timestamp_win_arm64_cntvct_el0() +{ + return _ReadStatusReg( TRACY_WINARM64_CNTVCT_EL0 ); +} #endif class Profiler From 460944ef4284a179baa5a6ff7ead460508058eee Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 6 Mar 2026 23:53:13 +0100 Subject: [PATCH 7/7] Cosmetics. --- profiler/src/BackendGlfw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiler/src/BackendGlfw.cpp b/profiler/src/BackendGlfw.cpp index 68cb632c..af957acb 100644 --- a/profiler/src/BackendGlfw.cpp +++ b/profiler/src/BackendGlfw.cpp @@ -139,10 +139,10 @@ Backend::Backend( const char* title, const std::function& redraw, const int code = glfwGetError( &description ); if( description ) { fprintf( stderr, "ERROR: Tracy (GLFW): %s\n", description ); -# ifdef _WIN32 +#ifdef _WIN32 MessageBoxA( NULL, description, "ERROR: Tracy (GLFW)", MB_OK ); OutputDebugStringA( description ); -# endif +#endif } exit( 1 ); }