mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Feat] (3rdparty/tracy): initial integration of Tracy Profiler
This commit is contained in:
@@ -10,3 +10,6 @@
|
||||
[submodule "include/FastSTL"]
|
||||
path = include/FastSTL
|
||||
url = https://github.com/MobileGL-Dev/FastSTL.git
|
||||
[submodule "3rdparty/tracy"]
|
||||
path = 3rdparty/tracy
|
||||
url = https://github.com/wolfpld/tracy.git
|
||||
|
||||
+1
Submodule 3rdparty/tracy added at e6b9ea4609
+14
-1
@@ -15,7 +15,7 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR MOBILEGL_FORCE_RELEASE_OPT)
|
||||
add_compile_options(-O3 -ffunction-sections -fdata-sections)
|
||||
add_link_options(-Wl,--gc-sections)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
add_compile_options(/O2 /GL)
|
||||
# add_compile_options(/O2)
|
||||
else ()
|
||||
add_compile_options(-O2)
|
||||
endif()
|
||||
@@ -77,6 +77,12 @@ set(SPIRV_CROSS_STATIC ON CACHE BOOL "Prefer static libs" FORCE)
|
||||
add_subdirectory(3rdparty/glslang)
|
||||
add_subdirectory(3rdparty/SPIRV-Cross)
|
||||
|
||||
option(TRACY_ENABLE "Enable Tracy" OFF)
|
||||
option(TRACY_ON_DEMAND "Enable profiling only connected" ON)
|
||||
option(TRACY_NO_EXIT "Don't exit Tracy until connected" OFF)
|
||||
|
||||
add_subdirectory(3rdparty/tracy)
|
||||
|
||||
set(SOURCE_FILES
|
||||
MobileGL/Init.cpp
|
||||
|
||||
@@ -250,6 +256,13 @@ target_link_libraries(${CMAKE_PROJECT_NAME}_s
|
||||
spirv-cross-c
|
||||
)
|
||||
|
||||
if (TRACY_ENABLE)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC Tracy::TracyClient)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_s PUBLIC Tracy::TracyClient)
|
||||
target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC -DTRACY_ENABLE)
|
||||
target_compile_definitions(${CMAKE_PROJECT_NAME}_s PUBLIC -DTRACY_ENABLE)
|
||||
endif ()
|
||||
|
||||
if (ANDROID)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC
|
||||
android
|
||||
|
||||
@@ -76,6 +76,10 @@
|
||||
#include <vulkan/vulkan_android.h>
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_ENABLE
|
||||
#include <tracy/Tracy.hpp>
|
||||
#endif
|
||||
|
||||
// Post-includes for significant project headers
|
||||
#include "MG_Util/Debug/Log.h"
|
||||
#include "MG_Util/Types.h"
|
||||
|
||||
Reference in New Issue
Block a user