pipeline: ignore driver in blend state tracking

This removes the various checks for != COGL_DRIVER_GLES1 when tracking
blend state that was trying to avoid checking the equation or alpha
component factors when they are known to be fixed on gles1. Now we just
rely on the opengl driver to do the right thing for the different
drivers and ignore the differences in the general pipeline state
tracking.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit f67c7eaf23e1e2088e9956cb2b66dfdc9abc8b3b)
This commit is contained in:
Robert Bragg 2013-05-29 16:20:58 +01:00
parent 9ef37423fc
commit cf002a7989

View File

@ -119,11 +119,9 @@ _cogl_pipeline_blend_state_equal (CoglPipeline *authority0,
_COGL_GET_CONTEXT (ctx, FALSE);
#if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
if (ctx->driver != COGL_DRIVER_GLES1)
{
if (blend_state0->blend_equation_rgb != blend_state1->blend_equation_rgb)
return FALSE;
if (blend_state0->blend_equation_alpha !=
blend_state1->blend_equation_alpha)
return FALSE;
@ -133,26 +131,23 @@ _cogl_pipeline_blend_state_equal (CoglPipeline *authority0,
if (blend_state0->blend_dst_factor_alpha !=
blend_state1->blend_dst_factor_alpha)
return FALSE;
}
#endif
if (blend_state0->blend_src_factor_rgb !=
blend_state1->blend_src_factor_rgb)
return FALSE;
if (blend_state0->blend_dst_factor_rgb !=
blend_state1->blend_dst_factor_rgb)
return FALSE;
#if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
if (ctx->driver != COGL_DRIVER_GLES1 &&
(blend_state0->blend_src_factor_rgb == GL_ONE_MINUS_CONSTANT_COLOR ||
if (blend_state0->blend_src_factor_rgb == GL_ONE_MINUS_CONSTANT_COLOR ||
blend_state0->blend_src_factor_rgb == GL_CONSTANT_COLOR ||
blend_state0->blend_dst_factor_rgb == GL_ONE_MINUS_CONSTANT_COLOR ||
blend_state0->blend_dst_factor_rgb == GL_CONSTANT_COLOR))
blend_state0->blend_dst_factor_rgb == GL_CONSTANT_COLOR)
{
if (!cogl_color_equal (&blend_state0->blend_constant,
&blend_state1->blend_constant))
return FALSE;
}
#endif
return TRUE;
}
@ -980,9 +975,7 @@ cogl_pipeline_set_blend (CoglPipeline *pipeline,
_cogl_pipeline_pre_change_notify (pipeline, state, NULL, FALSE);
blend_state = &pipeline->big_state->blend_state;
#if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES2)
if (ctx->driver != COGL_DRIVER_GLES1)
{
setup_blend_state (rgb,
&blend_state->blend_equation_rgb,
&blend_state->blend_src_factor_rgb,
@ -991,15 +984,6 @@ cogl_pipeline_set_blend (CoglPipeline *pipeline,
&blend_state->blend_equation_alpha,
&blend_state->blend_src_factor_alpha,
&blend_state->blend_dst_factor_alpha);
}
else
#endif
{
setup_blend_state (rgb,
NULL,
&blend_state->blend_src_factor_rgb,
&blend_state->blend_dst_factor_rgb);
}
/* If we are the current authority see if we can revert to one of our
* ancestors being the authority */
@ -1752,9 +1736,6 @@ _cogl_pipeline_hash_blend_state (CoglPipeline *authority,
hash = state->hash;
#if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
if (ctx->driver != COGL_DRIVER_GLES1)
{
hash =
_cogl_util_one_at_a_time_hash (hash, &blend_state->blend_equation_rgb,
sizeof (blend_state->blend_equation_rgb));
@ -1777,8 +1758,6 @@ _cogl_pipeline_hash_blend_state (CoglPipeline *authority,
_cogl_util_one_at_a_time_hash (hash, &blend_state->blend_constant,
sizeof (blend_state->blend_constant));
}
}
#endif
hash =
_cogl_util_one_at_a_time_hash (hash, &blend_state->blend_src_factor_rgb,