File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ project(gl_spinning_triangle LANGUAGES C CXX)
2020# ---------------------------------------------------------------------------
2121set (TRACY_DIR "${CMAKE_CURRENT_SOURCE_DIR } /../../.." )
2222option (TRACY_ENABLE "Enable Tracy profiling" ON )
23- option (TRACY_OPENGL_AUTO_CALIBRATION "Enable periodic GPU/CPU recalibration" ON )
2423
2524# ---------------------------------------------------------------------------
2625# Platform — RGFW (cross-platform windowing, fetched automatically)
@@ -85,9 +84,6 @@ target_compile_features(gl_spinning_triangle PRIVATE cxx_std_17)
8584if (TRACY_ENABLE)
8685 target_compile_definitions (gl_spinning_triangle PRIVATE TRACY_ENABLE )
8786endif ()
88- if (TRACY_OPENGL_AUTO_CALIBRATION)
89- target_compile_definitions (gl_spinning_triangle PRIVATE TRACY_OPENGL_AUTO_CALIBRATION )
90- endif ()
9187
9288target_include_directories (gl_spinning_triangle PRIVATE
9389 "${TRACY_DIR} /public"
Original file line number Diff line number Diff line change 66#pragma once
77
88#ifdef __APPLE__
9- // OpenGL is only available on MacOS (no iOS support)
10- // Anything from gl3.h will spew deprecation warnings when used,
11- // unless GL_SILENCE_DEPRECATION has been defined beforehand
12- //# define GL_SILENCE_DEPRECATION
139# include <OpenGL/gl3.h>
1410#else
1511# include <GL/glew.h>
Original file line number Diff line number Diff line change 11// spinning_triangle.cpp — OpenGL spinning triangle demo with Tracy GPU profiling.
2- //
3- // Tracy GPU zones are active on non-Apple platforms when TRACY_ENABLE is defined.
4- // TRACY_OPENGL_AUTO_CALIBRATION (enabled by default in CMakeLists.txt) enables
5- // periodic GPU/CPU drift correction via glGetInteger64v(GL_TIMESTAMP).
62
7- #include " platform/platform.h"
8- #include < cmath>
9- #include < cstdio>
3+ #ifdef __APPLE__
4+ // NOTE: OpenGL is only available on MacOS (no iOS support)
5+ // Including and using anything related to OpenGL on Apple (like <OpenGL/gl3.h>)
6+ // will emit deprecation warnings, unless GL_SILENCE_DEPRECATION is defined
7+ #define GL_SILENCE_DEPRECATION
8+ // NOTE: TracyOpenGL.hpp will not work as expected even on Apple devices that
9+ // support OpenGL, because the OpenGL drivers do not implement ARB_timer_query
10+ // properly (querying GL_TIMESTAMP always resolves to 0). TracyOpenGL.hpp will
11+ // emit a compiler warning, and a Tracy message to the trace/profiler, but the
12+ // program will still run.
13+ #endif
14+
15+ #include " platform/platform.h" // also includes OpenGL headers
1016
1117#include < tracy/Tracy.hpp>
18+
19+ // NOTE: opt-in toggle for periodic recalibrations during Collect()
20+ #define TRACY_OPENGL_AUTO_CALIBRATION
1221#include < tracy/TracyOpenGL.hpp>
1322
1423static const int kWidth = 800 ;
You can’t perform that action at this time.
0 commit comments