summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2009-06-29 12:21:06 +0100
committerRobert Bragg <robert@linux.intel.com>2009-06-30 10:38:16 +0100
commitc77eac56964a0687a6efcf1bd7aa0a3d5c71bd09 (patch)
treee4f5360b86cc25e8e624e58c66c54614134615a0
parentdbb8c13bd219af54fd7453d87b165839fd434a5b (diff)
downloadclutter-gst-c77eac56964a0687a6efcf1bd7aa0a3d5c71bd09.tar.gz
Get Cogl to flush primitives when using fragment shaders
Cogl doesn't support changing OpenGL state to modify how Cogl primitives work, but it also doesn't support ARBfp which we currently depend on. For now we at least ask Cogl to flush any batched primitives so we avoid binding our shader across the wrong geometry, but there is a risk that Cogl may start to use ARBfp internally which will conflict with us.
-rw-r--r--clutter-gst/clutter-gst-video-sink.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/clutter-gst/clutter-gst-video-sink.c b/clutter-gst/clutter-gst-video-sink.c
index db6c077..01659c3 100644
--- a/clutter-gst/clutter-gst-video-sink.c
+++ b/clutter-gst/clutter-gst-video-sink.c
@@ -554,6 +554,13 @@ clutter_gst_yv12_fp_paint (ClutterActor *actor,
if (priv->v_tex)
cogl_material_set_layer (material, 2, priv->v_tex);
+ /* Cogl doesn't support changing OpenGL state to modify how Cogl primitives
+ * work, but it also doesn't support ARBfp which we currently depend on. For
+ * now we at least ask Cogl to flush any batched primitives so we avoid
+ * binding our shader across the wrong geometry, but there is a risk that
+ * Cogl may start to use ARBfp internally which will conflict with us. */
+ cogl_flush ();
+
/* bind the shader */
glEnable (GL_FRAGMENT_PROGRAM_ARB);
priv->syms.glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, priv->fp);
@@ -566,6 +573,13 @@ clutter_gst_yv12_fp_post_paint (ClutterActor *actor,
{
CoglHandle material;
+ /* Cogl doesn't support changing OpenGL state to modify how Cogl primitives
+ * work, but it also doesn't support ARBfp which we currently depend on. For
+ * now we at least ask Cogl to flush any batched primitives so we avoid
+ * binding our shader across the wrong geometry, but there is a risk that
+ * Cogl may start to use ARBfp internally which will conflict with us. */
+ cogl_flush ();
+
/* Remove the extra layers */
material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (actor));
cogl_material_remove_layer (material, 1);