From ffe44b195f335689829c5e441d1072ee7d8eac9d Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 25 Aug 2020 15:02:47 -0700 Subject: Fixed GLES query function names --- .../src/DeviceContextGLImpl.cpp | 2 ++ .../GraphicsEngineOpenGL/src/GLStubsAndroid.cpp | 6 ++++-- .../src/RenderDeviceGLImpl.cpp | 22 +++++++++++++--------- 3 files changed, 19 insertions(+), 11 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') 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 -- cgit v1.2.3 From f1a6ac2e44bc09993b8730611f5a2cd525af7cab Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 25 Aug 2020 15:15:54 -0700 Subject: Fixed iOS build error --- Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h b/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h index bebbc669..884350d7 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; -- cgit v1.2.3 From 81bae8395e2ecdc0ab7523a5ecb35a79647bc369 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 25 Aug 2020 15:39:53 -0700 Subject: Fixed formatting --- Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h b/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h index 884350d7..4e5ec188 100644 --- a/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h +++ b/Graphics/GraphicsEngineOpenGL/include/GLStubsIOS.h @@ -544,4 +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; +static void (*glGetQueryObjectui64v)(GLuint id, GLenum pname, GLuint64* params) = nullptr; -- cgit v1.2.3