attribute: Fix including progend-glsl-private.h on GL2

Previously this header was only included on GLES2 but since 7283e0a4
the progend is used on any driver where GLSL is available. This
changes the #ifdef to check for the presence of the GLSL progend.

Based on a patch by Fan, Chun-wei

https://bugzilla.gnome.org/show_bug.cgi?id=665722

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2011-12-07 12:19:58 +00:00
parent 09520a7d61
commit 39203cb8f1

View File

@ -41,7 +41,7 @@
#include "cogl-texture-private.h" #include "cogl-texture-private.h"
#include "cogl-framebuffer-private.h" #include "cogl-framebuffer-private.h"
#include "cogl-indices-private.h" #include "cogl-indices-private.h"
#ifdef HAVE_COGL_GLES2 #ifdef COGL_PIPELINE_PROGEND_GLSL
#include "cogl-pipeline-progend-glsl-private.h" #include "cogl-pipeline-progend-glsl-private.h"
#endif #endif
#include "cogl-private.h" #include "cogl-private.h"
@ -481,6 +481,8 @@ foreach_changed_bit_and_save (CoglContext *context,
_cogl_bitmask_set_bits (current_bits, new_bits); _cogl_bitmask_set_bits (current_bits, new_bits);
} }
#ifdef COGL_PIPELINE_PROGEND_GLSL
static void static void
setup_generic_attribute (CoglContext *context, setup_generic_attribute (CoglContext *context,
CoglPipeline *pipeline, CoglPipeline *pipeline,
@ -503,6 +505,8 @@ setup_generic_attribute (CoglContext *context,
} }
} }
#endif /* COGL_PIPELINE_PROGEND_GLSL */
static void static void
apply_attribute_enable_updates (CoglContext *context, apply_attribute_enable_updates (CoglContext *context,
CoglPipeline *pipeline) CoglPipeline *pipeline)
@ -747,8 +751,10 @@ flush_state (CoglDrawFlags flags,
} }
break; break;
case COGL_ATTRIBUTE_NAME_ID_CUSTOM_ARRAY: case COGL_ATTRIBUTE_NAME_ID_CUSTOM_ARRAY:
#ifdef COGL_PIPELINE_PROGEND_GLSL
if (ctx->driver != COGL_DRIVER_GLES1) if (ctx->driver != COGL_DRIVER_GLES1)
setup_generic_attribute (ctx, source, attribute, base); setup_generic_attribute (ctx, source, attribute, base);
#endif
break; break;
default: default:
g_warning ("Unrecognised attribute type 0x%08x", attribute->type); g_warning ("Unrecognised attribute type 0x%08x", attribute->type);