[cogl] Flush the journal before changing the projection



commit 89fd2edeb088570c4fcecbbffa404b65b3dad868
Author: Robert Bragg <robert linux intel com>
Date:   Mon Aug 1 20:50:47 2011 +0100

    Flush the journal before changing the projection
    
    Since the projection matrix isn't tracked in the journal and since our
    software transform of vertices as we log into the journal doesn't
    include the projective transform we need to make sure we flush all
    primitives in the journal before ever changing the projection.
    
    Reviewed-by: Neil Roberts <neil linux intel com>

 cogl/cogl.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/cogl/cogl.c b/cogl/cogl.c
index e3eb3c3..e9621c2 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -826,6 +826,10 @@ cogl_frustum (float        left,
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
+  /* XXX: The projection matrix isn't currently tracked in the journal
+   * so we need to flush all journaled primitives first... */
+  cogl_flush ();
+
   _cogl_matrix_stack_load_identity (projection_stack);
 
   _cogl_matrix_stack_frustum (projection_stack,
@@ -851,6 +855,10 @@ cogl_ortho (float left,
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
+  /* XXX: The projection matrix isn't currently tracked in the journal
+   * so we need to flush all journaled primitives first... */
+  cogl_flush ();
+
   cogl_matrix_init_identity (&ortho);
   cogl_matrix_ortho (&ortho, left, right, bottom, top, z_near, z_far);
   _cogl_matrix_stack_set (projection_stack, &ortho);
@@ -888,10 +896,13 @@ cogl_set_projection_matrix (CoglMatrix *matrix)
 {
   CoglMatrixStack *projection_stack =
     _cogl_framebuffer_get_projection_stack (cogl_get_draw_framebuffer ());
+
+  /* XXX: The projection matrix isn't currently tracked in the journal
+   * so we need to flush all journaled primitives first... */
+  cogl_flush ();
+
   _cogl_matrix_stack_set (projection_stack, matrix);
 
-  /* FIXME: Update the inverse projection matrix!! Presumably use
-   * of clip planes must currently be broken if this API is used. */
   _COGL_MATRIX_DEBUG_PRINT (matrix);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]