cogl-gles2-wrapper: Layers aren't equal if one is enabled and one is not

Previously when comparing whether the settings for a layer are equal
it would only check if one of them was enabled. If so then it would
assume the other one was enabled and continue to compare the texture
environment. Now it also checks whether the enabledness differs.
This commit is contained in:
Neil Roberts 2010-07-13 13:59:07 +01:00
parent 698fd7d960
commit 31c127bfa7

View File

@ -252,34 +252,40 @@ cogl_gles2_settings_equal (const CoglGles2WrapperSettings *a,
/* Compare layer combine operation for each active unit */ /* Compare layer combine operation for each active unit */
if (fragment_tests) if (fragment_tests)
for (i = 0; i < COGL_GLES2_MAX_TEXTURE_UNITS; i++) for (i = 0; i < COGL_GLES2_MAX_TEXTURE_UNITS; i++)
if (COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (a->texture_units, i)) {
{ if (!!COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (a->texture_units, i) !=
const CoglGles2WrapperTexEnv *tex_env_a = a->tex_env + i; !!COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (b->texture_units, i))
const CoglGles2WrapperTexEnv *tex_env_b = b->tex_env + i; return FALSE;
int arg, n_args;
GLenum func;
if (tex_env_a->point_sprite_coords != if (COGL_GLES2_TEXTURE_UNIT_IS_ENABLED (a->texture_units, i))
tex_env_b->point_sprite_coords) {
return FALSE; const CoglGles2WrapperTexEnv *tex_env_a = a->tex_env + i;
const CoglGles2WrapperTexEnv *tex_env_b = b->tex_env + i;
int arg, n_args;
GLenum func;
func = tex_env_a->texture_combine_rgb_func; if (tex_env_a->point_sprite_coords !=
tex_env_b->point_sprite_coords)
return FALSE;
if (func != tex_env_b->texture_combine_rgb_func) func = tex_env_a->texture_combine_rgb_func;
return FALSE;
n_args = cogl_gles2_get_n_args_for_combine_func (func); if (func != tex_env_b->texture_combine_rgb_func)
return FALSE;
for (arg = 0; arg < n_args; arg++) n_args = cogl_gles2_get_n_args_for_combine_func (func);
{
if (tex_env_a->texture_combine_rgb_src[arg] != for (arg = 0; arg < n_args; arg++)
tex_env_b->texture_combine_rgb_src[arg]) {
return FALSE; if (tex_env_a->texture_combine_rgb_src[arg] !=
if (tex_env_a->texture_combine_rgb_op[arg] != tex_env_b->texture_combine_rgb_src[arg])
tex_env_b->texture_combine_rgb_op[arg]) return FALSE;
return FALSE; if (tex_env_a->texture_combine_rgb_op[arg] !=
} tex_env_b->texture_combine_rgb_op[arg])
} return FALSE;
}
}
}
return TRUE; return TRUE;
} }