2023-07-20 17:47:49 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef USE_TRACY_GPU
|
|
|
|
|
|
|
|
#include "Log.hpp"
|
|
|
|
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GLES2/gl2ext.h>
|
|
|
|
|
|
|
|
inline PFNGLQUERYCOUNTEREXTPROC glQueryCounter;
|
|
|
|
inline PFNGLGETQUERYOBJECTIVEXTPROC glGetQueryObjectiv;
|
|
|
|
inline PFNGLGETQUERYOBJECTUI64VEXTPROC glGetQueryObjectui64v;
|
|
|
|
|
|
|
|
#include "../../subprojects/tracy/public/tracy/TracyOpenGL.hpp"
|
|
|
|
|
|
|
|
inline void loadGLProc(void* pProc, const char* name) {
|
|
|
|
void* proc = (void*)eglGetProcAddress(name);
|
|
|
|
if (proc == NULL) {
|
2023-09-06 12:51:36 +02:00
|
|
|
Debug::log(CRIT, "[Tracy GPU Profiling] eglGetProcAddress({}) failed", name);
|
2023-07-20 17:47:49 +02:00
|
|
|
abort();
|
|
|
|
}
|
|
|
|
*(void**)pProc = proc;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TRACY_GPU_CONTEXT TracyGpuContext
|
|
|
|
#define TRACY_GPU_ZONE(e) TracyGpuZone(e)
|
|
|
|
#define TRACY_GPU_COLLECT TracyGpuCollect
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define TRACY_GPU_CONTEXT
|
|
|
|
#define TRACY_GPU_ZONE(e)
|
|
|
|
#define TRACY_GPU_COLLECT
|
|
|
|
|
|
|
|
#endif
|