journal: Support per-framebuffer journals
Instead of having a single journal per context, we now have a CoglJournal object for each CoglFramebuffer. This means we now don't have to flush the journal when switching/pushing/popping between different framebuffers so for example a Clutter scene that involves some ClutterEffect actors that transiently redirect to an FBO can still be batched. This also allows us to track state in the journal that relates to the current frame of its associated framebuffer which we'll need for our optimization for using the CPU to handle reading a single pixel back from a framebuffer when we know the whole scene is currently comprised of simple rectangles in a journal.
This commit is contained in:
@ -78,6 +78,7 @@ log_quad_sub_textures_cb (CoglHandle texture_handle,
|
||||
void *user_data)
|
||||
{
|
||||
TextureSlicedQuadState *state = user_data;
|
||||
CoglFramebuffer *framebuffer = _cogl_get_framebuffer ();
|
||||
CoglHandle texture_override;
|
||||
float quad_coords[4];
|
||||
|
||||
@ -120,7 +121,8 @@ log_quad_sub_textures_cb (CoglHandle texture_handle,
|
||||
else
|
||||
texture_override = texture_handle;
|
||||
|
||||
_cogl_journal_log_quad (quad_coords,
|
||||
_cogl_journal_log_quad (framebuffer->journal,
|
||||
quad_coords,
|
||||
state->pipeline,
|
||||
1, /* one layer */
|
||||
texture_override, /* replace the layer0 texture */
|
||||
@ -518,6 +520,7 @@ _cogl_multitexture_quad_single_primitive (const float *position,
|
||||
int n_layers = cogl_pipeline_get_n_layers (pipeline);
|
||||
ValidateTexCoordsState state;
|
||||
float *final_tex_coords = alloca (sizeof (float) * 4 * n_layers);
|
||||
CoglFramebuffer *framebuffer;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, FALSE);
|
||||
|
||||
@ -539,7 +542,9 @@ _cogl_multitexture_quad_single_primitive (const float *position,
|
||||
if (state.override_pipeline)
|
||||
pipeline = state.override_pipeline;
|
||||
|
||||
_cogl_journal_log_quad (position,
|
||||
framebuffer = _cogl_get_framebuffer ();
|
||||
_cogl_journal_log_quad (framebuffer->journal,
|
||||
position,
|
||||
pipeline,
|
||||
n_layers,
|
||||
COGL_INVALID_HANDLE, /* no texture override */
|
||||
|
Reference in New Issue
Block a user