From 2fdeefb65b776d39cd18ffd638f21d424c40b6f7 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 21 Nov 2014 18:52:39 -0600 Subject: [PATCH] Adds support for OpenGL ES draw_elements_base_vertex. This is the same extension that we all know and love but under a different name with some different requirements. In regular OpenGL fashion, you can't just move a desktop OpenGL extension to OpenGL ES without ratifying a new extension, which is why this falls under a EXT extension, which in turn causes it to have suffixes attached to their function names. This is the first step in our way towards conquering all mobile GPUs that don't support desktop OpenGL, hopefully we also can add support for buffer_storage to OpenGL ES as well so we can make full use of this extension. --- Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp | 6 ++++++ Source/Core/VideoBackends/OGL/Render.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp index 5cb449b00d..b5e45a16c0 100644 --- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp @@ -1536,6 +1536,12 @@ const GLFunc gl_function_array[] = GLFUNC_REQUIRES(glDrawRangeElementsBaseVertex, "GL_ARB_draw_elements_base_vertex"), GLFUNC_REQUIRES(glMultiDrawElementsBaseVertex, "GL_ARB_draw_elements_base_vertex"), + // EXT_draw_elements_base_vertex + GLFUNC_SUFFIX(glDrawElementsBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex !GL_ARB_draw_elements_base_vertex"), + GLFUNC_SUFFIX(glDrawElementsInstancedBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex VERSION_GLES3 !GL_ARB_draw_elements_base_vertex"), + GLFUNC_SUFFIX(glDrawRangeElementsBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex VERSION_GLES3 !GL_ARB_draw_elements_base_vertex"), + GLFUNC_SUFFIX(glMultiDrawElementsBaseVertex, EXT, "GL_EXT_draw_elements_base_vertex GL_EXT_multi_draw_arrays !GL_ARB_draw_elements_base_vertex"), + // ARB_sample_shading GLFUNC_REQUIRES(glMinSampleShadingARB, "GL_ARB_sample_shading"), diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 502b7d31af..3d21b6891c 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -475,7 +475,8 @@ Renderer::Renderer() g_ogl_config.bSupportsGLSLCache = GLExtensions::Supports("GL_ARB_get_program_binary"); g_ogl_config.bSupportsGLPinnedMemory = GLExtensions::Supports("GL_AMD_pinned_memory"); g_ogl_config.bSupportsGLSync = GLExtensions::Supports("GL_ARB_sync"); - g_ogl_config.bSupportsGLBaseVertex = GLExtensions::Supports("GL_ARB_draw_elements_base_vertex"); + g_ogl_config.bSupportsGLBaseVertex = GLExtensions::Supports("GL_ARB_draw_elements_base_vertex") || + GLExtensions::Supports("GL_EXT_draw_elements_base_vertex"); g_ogl_config.bSupportsGLBufferStorage = GLExtensions::Supports("GL_ARB_buffer_storage"); g_ogl_config.bSupportsMSAA = GLExtensions::Supports("GL_ARB_texture_multisample"); g_ogl_config.bSupportSampleShading = GLExtensions::Supports("GL_ARB_sample_shading");