Fix timer query breakage on webgl

This commit is contained in:
Mathias Agopian
2023-03-07 22:44:03 -08:00
parent 5c2bbcb4a1
commit 4a7a033d04
4 changed files with 2 additions and 39 deletions

View File

@@ -1258,11 +1258,6 @@ void OpenGLDriver::createSwapChainHeadlessR(Handle<HwSwapChain> sch,
void OpenGLDriver::createTimerQueryR(Handle<HwTimerQuery> tqh, int) {
DEBUG_MARKER()
#if defined(GL_EXT_disjoint_timer_query) && defined(FILAMENT_IMPORT_ENTRY_POINTS)
// glGenQueries exists in core ES 3.0 and since GL 3.3
using glext::glGenQueries;
#endif
GLTimerQuery* tq = handle_cast<GLTimerQuery*>(tqh);
glGenQueries(1u, &tq->gl.query);
CHECK_GL_ERROR(utils::slog.e)
@@ -1419,11 +1414,6 @@ void OpenGLDriver::destroyStream(Handle<HwStream> sh) {
void OpenGLDriver::destroyTimerQuery(Handle<HwTimerQuery> tqh) {
DEBUG_MARKER()
#if defined(GL_EXT_disjoint_timer_query) && defined(FILAMENT_IMPORT_ENTRY_POINTS)
// glDeleteQueries exists in core ES 3.0 and since GL 3.3
using glext::glDeleteQueries;
#endif
if (tqh) {
GLTimerQuery* tq = handle_cast<GLTimerQuery*>(tqh);
glDeleteQueries(1u, &tq->gl.query);

View File

@@ -45,29 +45,17 @@ void TimerQueryNative::flush() {
}
void TimerQueryNative::beginTimeElapsedQuery(GLTimerQuery* query) {
#if defined(GL_EXT_disjoint_timer_query) && defined(FILAMENT_IMPORT_ENTRY_POINTS)
// glBeginQuery exists in core ES 3.0 and since GL 3.3
using glext::glBeginQuery;
#endif
glBeginQuery(GL_TIME_ELAPSED, query->gl.query);
CHECK_GL_ERROR(utils::slog.e)
}
void TimerQueryNative::endTimeElapsedQuery(GLTimerQuery*) {
#if defined(GL_EXT_disjoint_timer_query) && defined(FILAMENT_IMPORT_ENTRY_POINTS)
// glEndQuery exists in core ES 3.0 and since GL 3.3
using glext::glEndQuery;
#endif
glEndQuery(GL_TIME_ELAPSED);
CHECK_GL_ERROR(utils::slog.e)
}
bool TimerQueryNative::queryResultAvailable(GLTimerQuery* query) {
GLuint available = 0;
#if defined(GL_EXT_disjoint_timer_query) && defined(FILAMENT_IMPORT_ENTRY_POINTS)
// glGetQueryObjectuiv exists in core ES 3.0 and since GL 3.3
using glext::glGetQueryObjectuiv;
#endif
glGetQueryObjectuiv(query->gl.query, GL_QUERY_RESULT_AVAILABLE, &available);
CHECK_GL_ERROR(utils::slog.e)
return available != 0;

View File

@@ -49,11 +49,6 @@ PFNGLDEBUGMESSAGECALLBACKKHRPROC glDebugMessageCallbackKHR;
PFNGLGETDEBUGMESSAGELOGKHRPROC glGetDebugMessageLogKHR;
#endif
#ifdef GL_EXT_disjoint_timer_query
PFNGLGENQUERIESEXTPROC glGenQueries;
PFNGLDELETEQUERIESEXTPROC glDeleteQueries;
PFNGLBEGINQUERYEXTPROC glBeginQuery;
PFNGLENDQUERYEXTPROC glEndQuery;
PFNGLGETQUERYOBJECTUIVEXTPROC glGetQueryObjectuiv;
PFNGLGETQUERYOBJECTUI64VEXTPROC glGetQueryObjectui64v;
#endif
#ifdef GL_EXT_clip_control
@@ -91,11 +86,6 @@ void importGLESExtensionsEntryPoints() {
getProcAddress(glGetDebugMessageLogKHR, "glGetDebugMessageLogKHR");
#endif
#ifdef GL_EXT_disjoint_timer_query
getProcAddress(glGenQueries, "glGenQueriesEXT");
getProcAddress(glDeleteQueries, "glDeleteQueriesEXT");
getProcAddress(glBeginQuery, "glBeginQueryEXT");
getProcAddress(glEndQuery, "glEndQueryEXT");
getProcAddress(glGetQueryObjectuiv, "glGetQueryObjectuivEXT");
getProcAddress(glGetQueryObjectui64v, "glGetQueryObjectui64vEXT");
#endif
#ifdef GL_EXT_clip_control

View File

@@ -96,11 +96,6 @@ extern PFNGLGETDEBUGMESSAGELOGKHRPROC glGetDebugMessageLogKHR;
extern PFNGLCLIPCONTROLEXTPROC glClipControl;
#endif
#ifdef GL_EXT_disjoint_timer_query
extern PFNGLGENQUERIESEXTPROC glGenQueries;
extern PFNGLDELETEQUERIESEXTPROC glDeleteQueries;
extern PFNGLBEGINQUERYEXTPROC glBeginQuery;
extern PFNGLENDQUERYEXTPROC glEndQuery;
extern PFNGLGETQUERYOBJECTUIVEXTPROC glGetQueryObjectuiv;
extern PFNGLGETQUERYOBJECTUI64VEXTPROC glGetQueryObjectui64v;
#endif
#if defined(__ANDROID__)