@@ -146,5 +146,10 @@ private:
PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
PFNGLGETSTRINGPROC glGetString;
+ PFNGLBEGINQUERYPROC glBeginQuery;
+ PFNGLENDQUERYPROC glEndQuery;
+ PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv;
+ PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectui64v;
+ PFNGLGENQUERIESPROC glGenQueries;
};
} //namespace libcamera
@@ -390,6 +390,36 @@ int eGL::initEGLContext()
goto fail;
}
+ glBeginQuery = (PFNGLBEGINQUERYPROC)eglGetProcAddress("glBeginQuery");
+ if (!glBeginQuery) {
+ LOG(eGL, Error) << "glBegin not found";
+ goto fail;
+ }
+
+ glEndQuery = (PFNGLENDQUERYPROC)eglGetProcAddress("glEndQuery");
+ if (!glEndQuery) {
+ LOG(eGL, Error) << "glEndQuery not found";
+ goto fail;
+ }
+
+ glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)eglGetProcAddress("glGetQueryObjectuiv");
+ if (!glGetQueryObjectuiv) {
+ LOG(eGL, Error) << "glGetQueryObjectuiv not found";
+ goto fail;
+ }
+
+ glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUIVPROC)eglGetProcAddress("glGetQueryObjectui64v");
+ if (!glGetQueryObjectuiv) {
+ LOG(eGL, Error) << "glGetQueryObjectui64v not found";
+ goto fail;
+ }
+
+ glGenQueries = (PFNGLGENQUERIESPROC)eglGetProcAddress("glGenQueries");
+ if (!glGetQueryObjectuiv) {
+ LOG(eGL, Error) << "glGenQueries not found";
+ goto fail;
+ }
+
if (eglChooseConfig(display_, configAttribs, &config, 1, &numConfigs) != EGL_TRUE) {
LOG(eGL, Error) << "eglChooseConfig fail";
goto fail;
Add lookups for: - glBeingQuery - glEndQuery - glGetAueryObjectuiv - glGetAueryObjectui64v Used in the right way these methods will allows us to interrogate exactly how long each GPUISP pass takes. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- include/libcamera/internal/egl.h | 5 +++++ src/libcamera/egl.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+)