diff --git a/clutter/cogl/cogl/cogl-journal.c b/clutter/cogl/cogl/cogl-journal.c index 9e6ea22eb..1ccf1dbe8 100644 --- a/clutter/cogl/cogl/cogl-journal.c +++ b/clutter/cogl/cogl/cogl-journal.c @@ -235,7 +235,8 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start, CoglVertexAttribute **attributes; CoglDrawFlags draw_flags = (COGL_DRAW_SKIP_JOURNAL_FLUSH | COGL_DRAW_SKIP_PIPELINE_VALIDATION | - COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH); + COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH | + COGL_DRAW_SKIP_LEGACY_STATE); COGL_STATIC_TIMER (time_flush_modelview_and_entries, "flush: pipeline+entries", /* parent */ diff --git a/clutter/cogl/cogl/cogl-vertex-attribute-private.h b/clutter/cogl/cogl/cogl-vertex-attribute-private.h index b3a0e081e..a5663123d 100644 --- a/clutter/cogl/cogl/cogl-vertex-attribute-private.h +++ b/clutter/cogl/cogl/cogl-vertex-attribute-private.h @@ -62,13 +62,17 @@ typedef enum COGL_DRAW_SKIP_JOURNAL_FLUSH = 1 << 0, COGL_DRAW_SKIP_PIPELINE_VALIDATION = 1 << 1, COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH = 1 << 2, + /* When flushing from the journal the logged pipeline will already + contain the legacy state overrides so we don't want to apply them + again when we flush the pipeline for drawing */ + COGL_DRAW_SKIP_LEGACY_STATE = 1 << 3, /* By default the vertex attribute drawing code will assume that if there is a color attribute array enabled then we can't determine if the colors will be opaque so we need to enabling blending. However when drawing from the journal we know what the contents of the color array is so we can override this by passing this flag. */ - COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 3 + COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 4 } CoglDrawFlags; CoglVertexAttribute * diff --git a/clutter/cogl/cogl/cogl-vertex-attribute.c b/clutter/cogl/cogl/cogl-vertex-attribute.c index eb1451613..715a176fe 100644 --- a/clutter/cogl/cogl/cogl-vertex-attribute.c +++ b/clutter/cogl/cogl/cogl-vertex-attribute.c @@ -563,7 +563,8 @@ enable_gl_state (CoglDrawFlags flags, */ } - if (G_UNLIKELY (ctx->legacy_state_set)) + if (G_UNLIKELY (ctx->legacy_state_set) && + (flags & COGL_DRAW_SKIP_LEGACY_STATE) == 0) { /* If we haven't already created a derived pipeline... */ if (!copy) @@ -1033,7 +1034,8 @@ draw_wireframe (CoglVerticesMode mode, wire_attribute, COGL_DRAW_SKIP_JOURNAL_FLUSH | COGL_DRAW_SKIP_PIPELINE_VALIDATION | - COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH); + COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH | + COGL_DRAW_SKIP_LEGACY_STATE); cogl_debug_flags |= COGL_DEBUG_WIREFRAME;