[material] _cogl_material_equal: catch the simplest case of matching handles

We were missing the simplest test of all: are the two CoglHandles equal and
are the flush option flags for each material equal?  This should improve
batching for some common cases.
This commit is contained in:
Robert Bragg 2009-06-17 23:31:40 +01:00
parent 9afa52f056
commit 6ac3b5a564

View File

@ -1629,6 +1629,10 @@ _cogl_material_equal (CoglHandle material0_handle,
CoglMaterial *material1;
GList *l0, *l1;
if (material0_handle == material1_handle &&
material0_flush_options->flags == material1_flush_options->flags)
return TRUE;
if (!(flags & COGL_MATERIAL_EQUAL_FLAGS_ASSERT_ALL_DEFAULTS))
{
g_critical ("FIXME: _cogl_material_equal doesn't yet support "