From 6b0b07a8a600030b4dfdb6d72dc09f269465540b Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 11 Nov 2009 13:38:52 +0000 Subject: [PATCH] cogl-material: Fallback to BlendFunc if BlendFuncSeparate is unavailable glBlendFuncSeparate is only available in OpenGL 1.4. If we conditionally check for this then Clutter will work with OpenGL 1.2. http://bugzilla.openedhand.com/show_bug.cgi?id=1875 --- cogl/cogl-material.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cogl/cogl-material.c b/cogl/cogl-material.c index a050e1a11..7ac8340dd 100644 --- a/cogl/cogl-material.c +++ b/cogl/cogl-material.c @@ -1546,16 +1546,21 @@ _cogl_material_flush_base_gl_state (CoglMaterial *material, { #if defined (HAVE_COGL_GLES2) gboolean have_blend_equation_seperate = TRUE; + gboolean have_blend_func_separate = TRUE; #elif defined (HAVE_COGL_GL) gboolean have_blend_equation_seperate = FALSE; + gboolean have_blend_func_separate = FALSE; if (ctx->drv.pf_glBlendEquationSeparate) /* Only GL 2.0 + */ have_blend_equation_seperate = TRUE; + if (ctx->drv.pf_glBlendFuncSeparate) /* Only GL 1.4 + */ + have_blend_func_separate = TRUE; #endif #ifndef HAVE_COGL_GLES /* GLES 1 only has glBlendFunc */ - if (material->blend_src_factor_rgb != material->blend_src_factor_alpha - || (material->blend_src_factor_rgb != - material->blend_src_factor_alpha)) + if (have_blend_func_separate && + (material->blend_src_factor_rgb != material->blend_src_factor_alpha || + (material->blend_src_factor_rgb != + material->blend_src_factor_alpha))) { if (have_blend_equation_seperate && material->blend_equation_rgb != material->blend_equation_alpha)