summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-27 16:10:14 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-27 16:10:14 +0000
commitf3bbd963aa0e5ddf18f4bacee7d9d07a769206cf (patch)
treef3ceb941e9e3a0685364dede9148fe57e268a71e /Graphics/GraphicsEngineOpenGL
parentEnabled duration queries in GL backend (diff)
parentFixed formatting (diff)
downloadDiligentCore-f3bbd963aa0e5ddf18f4bacee7d9d07a769206cf.tar.gz
DiligentCore-f3bbd963aa0e5ddf18f4bacee7d9d07a769206cf.zip
Merged master
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h1
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp4
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp25
4 files changed, 20 insertions, 12 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h b/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h
index bebbc669..4e5ec188 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h
+++ b/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h
@@ -544,3 +544,4 @@ static void (*glPolygonMode)(GLenum face, GLenum mode) = nullptr;
#define glColorMaski(...) UnsupportedGLFunctionStub("glColorMaski")
#define glFramebufferTexture(...) UnsupportedGLFunctionStub("glFramebufferTexture")
#define glFramebufferTexture1D(...) UnsupportedGLFunctionStub("glFramebufferTexture1D")
+static void (*glGetQueryObjectui64v)(GLuint id, GLenum pname, GLuint64* params) = nullptr;
diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
index a479cb49..7612287b 100644
--- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
@@ -1370,6 +1370,7 @@ void DeviceContextGLImpl::EndQuery(IQuery* pQuery)
break;
case QUERY_TYPE_TIMESTAMP:
+#if GL_TIMESTAMP
if (glQueryCounter != nullptr)
{
glQueryCounter(pQueryGLImpl->GetGlQueryHandle(), GL_TIMESTAMP);
@@ -1379,6 +1380,7 @@ void DeviceContextGLImpl::EndQuery(IQuery* pQuery)
{
LOG_ERROR_MESSAGE_ONCE("Timer queries are not supported by this device");
}
+#endif
break;
case QUERY_TYPE_DURATION:
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp b/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp
index e426b2ca..54258fa7 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp
@@ -378,11 +378,11 @@ Func = (FuncType)eglGetProcAddress( #Func );\
#ifdef LOAD_GL_GET_QUERY_OBJECT_UI64V
// Do not use stub
- glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)eglGetProcAddress( "glGetQueryObjectui64v" );
+ glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)eglGetProcAddress( "glGetQueryObjectui64vEXT" );
#endif
#ifdef LOAD_GL_QUERY_COUNTER
// Do not use stub
- glQueryCounter = (PFNGLQUERYCOUNTERPROC)eglGetProcAddress( "glQueryCounter" );
+ glQueryCounter = (PFNGLQUERYCOUNTERPROC)eglGetProcAddress( "glQueryCounterEXT" );
#endif
}
diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
index ff9c95e0..6d0948ae 100644
--- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp
@@ -205,16 +205,21 @@ 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.DurationQueries = strstr(Extensions, "disjoint_timer_query") && glGetQueryObjectui64v != nullptr;
- 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");
+ Features.DurationQueries = Features.TimestampQueries;
+#else
+ Features.TimestampQueries = False;
+ Features.DurationQueries = 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