mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +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/SPIRV-Cross)
|
||||
|
||||
set(TRACY_ENABLE OFF CACHE BOOL "Enable Tracy")
|
||||
set(TRACY_ON_DEMAND ON CACHE BOOL "Enable profiling only connected")
|
||||
set(TRACY_ENABLE ON CACHE BOOL "Enable Tracy" FORCE)
|
||||
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_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)
|
||||
|
||||
|
||||
@@ -78,6 +78,9 @@
|
||||
|
||||
#ifdef TRACY_ENABLE
|
||||
#include <tracy/Tracy.hpp>
|
||||
#define TRACY_ZONECOLOR_ENTRY 0xFF0000
|
||||
#define TRACY_ZONECOLOR_FRONTEND 0x00FF00
|
||||
#define TRACY_ZONECOLOR_BACKEND 0x00FF00
|
||||
#endif
|
||||
|
||||
// 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,
|
||||
const EGLint* attrib_list) {
|
||||
#ifdef TRACY_ENABLE
|
||||
tracy::StartupProfiler();
|
||||
#endif
|
||||
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) {
|
||||
#ifdef TRACY_ENABLE
|
||||
tracy::ShutdownProfiler();
|
||||
#endif
|
||||
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) {
|
||||
#ifdef TRACY_ENABLE
|
||||
FrameMark;
|
||||
#endif
|
||||
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,...) \
|
||||
MOBILEGL_GL_API type gl##name(__VA_ARGS__) {
|
||||
|
||||
#define DECLARE_GL_FUNCTION_END(type,name,...) \
|
||||
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
||||
return MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
||||
}
|
||||
#ifdef TRACY_ENABLE
|
||||
#define DECLARE_GL_FUNCTION_END(type,name,...) \
|
||||
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,...) \
|
||||
MGLOG_D("Implementing function: %s(...)", __FUNCTION__); \
|
||||
MobileGL::MG_Impl::GLImpl::name(__VA_ARGS__); \
|
||||
}
|
||||
#define DECLARE_GL_FUNCTION_END_NO_RETURN(type,name,...) \
|
||||
ZoneScopedC(TRACY_ZONECOLOR_ENTRY); \
|
||||
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*, GetString, GLenum name) DECLARE_GL_FUNCTION_END(const GLubyte*, GetString, name)
|
||||
|
||||
Reference in New Issue
Block a user