summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-25 22:02:47 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-25 22:02:47 +0000
commitffe44b195f335689829c5e441d1072ee7d8eac9d (patch)
treecccc57cbda1b1429feb3f2e1b56a450ae3774112 /Graphics/GraphicsEngineOpenGL
parentEnabled loading of timer query GL functions on Android (diff)
downloadDiligentCore-ffe44b195f335689829c5e441d1072ee7d8eac9d.tar.gz
DiligentCore-ffe44b195f335689829c5e441d1072ee7d8eac9d.zip
Fixed GLES query function names
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp6
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp22
3 files changed, 19 insertions, 11 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
index e1755125..b5558a8d 100644
--- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
@@ -1365,6 +1365,7 @@ void DeviceContextGLImpl::EndQuery(IQuery* pQuery)
break;
case QUERY_TYPE_TIMESTAMP:
+#if GL_TIMESTAMP
if (glQueryCounter != nullptr)
{
glQueryCounter(pQueryGLImpl->GetGlQueryHandle(), GL_TIMESTAMP);
@@ -1374,6 +1375,7 @@ void DeviceContextGLImpl::EndQuery(IQuery* pQuery)
{
LOG_ERROR_MESSAGE_ONCE("Timer queries are not supported by this device");
}
+#endif
break;
default:
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp b/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp
index 428764ee..54258fa7 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp
@@ -377,10 +377,12 @@ Func = (FuncType)eglGetProcAddress( #Func );\
#endif
#ifdef LOAD_GL_GET_QUERY_OBJECT_UI64V
- LOAD_GL_FUNCTION(glGetQueryObjectui64v, PFNGLGETQUERYOBJECTUI64VPROC)
+ // Do not use stub
+ glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)eglGetProcAddress( "glGetQueryObjectui64vEXT" );
#endif
#ifdef LOAD_GL_QUERY_COUNTER
- glQueryCounter = (PFNGLQUERYCOUNTERPROC)eglGetProcAddress( "glQueryCounter" );
+ // Do not use stub
+ glQueryCounter = (PFNGLQUERYCOUNTERPROC)eglGetProcAddress( "glQueryCounterEXT" );
#endif
}
diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
index 9b267441..17bc8346 100644
--- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
@@ -204,15 +204,19 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters,
Features.BindlessResources = False;
Features.OcclusionQueries = False;
Features.BinaryOcclusionQueries = True; // Supported in GLES3.0
- Features.TimestampQueries = strstr(Extensions, "disjoint_timer_query") && glQueryCounter != nullptr;
- Features.PipelineStatisticsQueries = False;
- Features.DepthBiasClamp = False; // There is no depth bias clamp in OpenGL
- Features.DepthClamp = strstr(Extensions, "depth_clamp");
- Features.IndependentBlend = IsGLES32OrAbove;
- Features.DualSourceBlend = strstr(Extensions, "blend_func_extended");
- Features.MultiViewport = strstr(Extensions, "viewport_array");
- Features.PixelUAVWritesAndAtomics = IsGLES31OrAbove || strstr(Extensions, "shader_image_load_store");
- Features.TextureUAVExtendedFormats = False;
+#if GL_TIMESTAMP
+ Features.TimestampQueries = strstr(Extensions, "disjoint_timer_query");
+#else
+ Features.TimestampQueries = False;
+#endif
+ Features.PipelineStatisticsQueries = False;
+ Features.DepthBiasClamp = False; // There is no depth bias clamp in OpenGL
+ Features.DepthClamp = strstr(Extensions, "depth_clamp");
+ Features.IndependentBlend = IsGLES32OrAbove;
+ Features.DualSourceBlend = strstr(Extensions, "blend_func_extended");
+ Features.MultiViewport = strstr(Extensions, "viewport_array");
+ Features.PixelUAVWritesAndAtomics = IsGLES31OrAbove || strstr(Extensions, "shader_image_load_store");
+ Features.TextureUAVExtendedFormats = False;
TexCaps.MaxTexture1DDimension = 0; // Not supported in GLES 3.2