From b7eb60d2b7f6a9314eae8194343cd52de4fde13b Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 30 Sep 2013 10:11:16 +0200 Subject: [PATCH] OpenGL ES 2.0: Detect EXT_blend_minmax --- gfx_es2/gl_state.cpp | 4 ++++ gfx_es2/gl_state.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gfx_es2/gl_state.cpp b/gfx_es2/gl_state.cpp index b40d783108..2d3af0b83a 100644 --- a/gfx_es2/gl_state.cpp +++ b/gfx_es2/gl_state.cpp @@ -122,6 +122,7 @@ void CheckGLExtensions() { gl_extensions.OES_depth24 = strstr(extString, "GL_OES_depth24") != 0; gl_extensions.OES_depth_texture = strstr(extString, "GL_OES_depth_texture") != 0; gl_extensions.OES_mapbuffer = strstr(extString, "GL_OES_mapbuffer") != 0; + gl_extensions.EXT_blend_minmax = strstr(extString, "GL_EXT_blend_minmax") != 0; gl_extensions.EXT_shader_framebuffer_fetch = (strstr(extString, "GL_EXT_shader_framebuffer_fetch") != 0) || (strstr(extString, "GL_NV_shader_framebuffer_fetch") != 0); #if defined(IOS) || defined(__SYMBIAN32__) || defined(MEEGO_EDITION_HARMATTAN) || defined(MAEMO) gl_extensions.OES_vertex_array_object = false; @@ -141,6 +142,9 @@ void CheckGLExtensions() { } #endif +#else + // Desktops support minmax + gl_extensions.EXT_blend_minmax = true; #endif #if defined(ANDROID) || defined(BLACKBERRY) diff --git a/gfx_es2/gl_state.h b/gfx_es2/gl_state.h index b5ac5057a8..53c87ce4ab 100644 --- a/gfx_es2/gl_state.h +++ b/gfx_es2/gl_state.h @@ -231,6 +231,7 @@ public: BoolState blend; STATE4(glBlendFuncSeparate, GLenum, GLenum, GLenum, GLenum, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) blendFuncSeparate; + // On OpenGL ES, using minmax blend requires glBlendEquationEXT (in theory at least). STATE1(glBlendEquation, GLenum, GL_FUNC_ADD) blendEquation; STATEFLOAT4(glBlendColor, 1.0f) blendColor; @@ -304,6 +305,7 @@ struct GLExtensions { bool OES_mapbuffer; bool OES_vertex_array_object; bool EXT_shader_framebuffer_fetch; + bool EXT_blend_minmax; bool ATIClampBug; // EGL extensions