mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Feat] (3rdparty/tracy): initial integration of Tracy Profiler
This commit is contained in:
@@ -10,3 +10,6 @@
|
|||||||
[submodule "include/FastSTL"]
|
[submodule "include/FastSTL"]
|
||||||
path = include/FastSTL
|
path = include/FastSTL
|
||||||
url = https://github.com/MobileGL-Dev/FastSTL.git
|
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_compile_options(-O3 -ffunction-sections -fdata-sections)
|
||||||
add_link_options(-Wl,--gc-sections)
|
add_link_options(-Wl,--gc-sections)
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
add_compile_options(/O2 /GL)
|
# add_compile_options(/O2)
|
||||||
else ()
|
else ()
|
||||||
add_compile_options(-O2)
|
add_compile_options(-O2)
|
||||||
endif()
|
endif()
|
||||||
@@ -77,6 +77,12 @@ set(SPIRV_CROSS_STATIC ON CACHE BOOL "Prefer static libs" FORCE)
|
|||||||
add_subdirectory(3rdparty/glslang)
|
add_subdirectory(3rdparty/glslang)
|
||||||
add_subdirectory(3rdparty/SPIRV-Cross)
|
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
|
set(SOURCE_FILES
|
||||||
MobileGL/Init.cpp
|
MobileGL/Init.cpp
|
||||||
|
|
||||||
@@ -250,6 +256,13 @@ target_link_libraries(${CMAKE_PROJECT_NAME}_s
|
|||||||
spirv-cross-c
|
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)
|
if (ANDROID)
|
||||||
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC
|
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC
|
||||||
android
|
android
|
||||||
|
|||||||
@@ -76,6 +76,10 @@
|
|||||||
#include <vulkan/vulkan_android.h>
|
#include <vulkan/vulkan_android.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TRACY_ENABLE
|
||||||
|
#include <tracy/Tracy.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Post-includes for significant project headers
|
// Post-includes for significant project headers
|
||||||
#include "MG_Util/Debug/Log.h"
|
#include "MG_Util/Debug/Log.h"
|
||||||
#include "MG_Util/Types.h"
|
#include "MG_Util/Types.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user