mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Feat] (tracy): initial tracy integration
This commit is contained in:
+4
-2
@@ -77,9 +77,11 @@ 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)
|
||||||
|
|
||||||
set(TRACY_ENABLE OFF CACHE BOOL "Enable Tracy")
|
set(TRACY_ENABLE ON CACHE BOOL "Enable Tracy" FORCE)
|
||||||
set(TRACY_ON_DEMAND ON CACHE BOOL "Enable profiling only connected")
|
set(TRACY_ON_DEMAND ON CACHE BOOL "Enable profiling only connected" FORCE)
|
||||||
set(TRACY_NO_EXIT OFF CACHE BOOL "Don't exit Tracy until connected" FORCE)
|
set(TRACY_NO_EXIT OFF CACHE BOOL "Don't exit Tracy until connected" FORCE)
|
||||||
|
set(TRACY_DELAYED_INIT ON CACHE BOOL "Don't init Tracy on library load" FORCE)
|
||||||
|
set(TRACY_MANUAL_LIFETIME ON CACHE BOOL "Manually control Tracy lifetime" FORCE)
|
||||||
|
|
||||||
add_subdirectory(3rdparty/tracy)
|
add_subdirectory(3rdparty/tracy)
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,9 @@
|
|||||||
|
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
#include <tracy/Tracy.hpp>
|
#include <tracy/Tracy.hpp>
|
||||||
|
#define TRACY_ZONECOLOR_ENTRY 0xFF0000
|
||||||
|
#define TRACY_ZONECOLOR_FRONTEND 0x00FF00
|
||||||
|
#define TRACY_ZONECOLOR_BACKEND 0x00FF00
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Post-includes for significant project headers
|
// Post-includes for significant project headers
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ MOBILEGL_EGL_API EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint* attrib
|
|||||||
|
|
||||||
MOBILEGL_EGL_API EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext shareCtx,
|
MOBILEGL_EGL_API EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext shareCtx,
|
||||||
const EGLint* attrib_list) {
|
const EGLint* attrib_list) {
|
||||||
|
#ifdef TRACY_ENABLE
|
||||||
|
tracy::StartupProfiler();
|
||||||
|
#endif
|
||||||
return MobileGL::MG_Impl::EGLImpl::CreateContext(dpy, config, shareCtx, attrib_list);
|
return MobileGL::MG_Impl::EGLImpl::CreateContext(dpy, config, shareCtx, attrib_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,6 +36,9 @@ MOBILEGL_EGL_API EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLS
|
|||||||
}
|
}
|
||||||
|
|
||||||
MOBILEGL_EGL_API EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {
|
MOBILEGL_EGL_API EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) {
|
||||||
|
#ifdef TRACY_ENABLE
|
||||||
|
tracy::ShutdownProfiler();
|
||||||
|
#endif
|
||||||
return MobileGL::MG_Impl::EGLImpl::DestroyContext(dpy, ctx);
|
return MobileGL::MG_Impl::EGLImpl::DestroyContext(dpy, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +79,9 @@ MOBILEGL_EGL_API EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MOBILEGL_EGL_API EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) {
|
MOBILEGL_EGL_API EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) {
|
||||||
|
#ifdef TRACY_ENABLE
|
||||||
|
FrameMark;
|
||||||
|
#endif
|
||||||
return MobileGL::MG_Impl::EGLImpl::SwapBuffers(dpy, draw);
|
return MobileGL::MG_Impl::EGLImpl::SwapBuffers(dpy, draw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,15 +24,29 @@ MOBILEGL_GL_API type gl##name(__VA_ARGS__) {
|
|||||||
#define DECLARE_GL_FUNCTION_HEAD(type,name,...) \
|
#define DECLARE_GL_FUNCTION_HEAD(type,name,...) \
|
||||||
MOBILEGL_GL_API type gl##name(__VA_ARGS__) {
|
MOBILEGL_GL_API type gl##name(__VA_ARGS__) {
|
||||||
|
|
||||||
#define DECLARE_GL_FUNCTION_END(type,name,...) \
|
#ifdef TRACY_ENABLE
|
||||||
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
#define DECLARE_GL_FUNCTION_END(type,name,...) \
|
||||||
return MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
ZoneScopedC(TRACY_ZONECOLOR_ENTRY); \
|
||||||
}
|
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
||||||
|
return MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
||||||
|
}
|
||||||
|
|
||||||
#define DECLARE_GL_FUNCTION_END_NO_RETURN(type,name,...) \
|
#define DECLARE_GL_FUNCTION_END_NO_RETURN(type,name,...) \
|
||||||
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
ZoneScopedC(TRACY_ZONECOLOR_ENTRY); \
|
||||||
MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
||||||
}
|
MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define DECLARE_GL_FUNCTION_END(type,name,...) \
|
||||||
|
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
||||||
|
return MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DECLARE_GL_FUNCTION_END_NO_RETURN(type,name,...) \
|
||||||
|
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
||||||
|
MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DECLARE_GL_FUNCTION_HEAD(const GLubyte*, GetStringi, GLenum name, GLuint index) DECLARE_GL_FUNCTION_END(const GLubyte*, GetStringi, name, index)
|
DECLARE_GL_FUNCTION_HEAD(const GLubyte*, GetStringi, GLenum name, GLuint index) DECLARE_GL_FUNCTION_END(const GLubyte*, GetStringi, name, index)
|
||||||
DECLARE_GL_FUNCTION_HEAD(const GLubyte*, GetString, GLenum name) DECLARE_GL_FUNCTION_END(const GLubyte*, GetString, name)
|
DECLARE_GL_FUNCTION_HEAD(const GLubyte*, GetString, GLenum name) DECLARE_GL_FUNCTION_END(const GLubyte*, GetString, name)
|
||||||
|
|||||||
Reference in New Issue
Block a user