cogl-material: Consider the shader when deciding if materials equate
_cogl_material_equal was ignoring the user shader state so rectangles with different shaders would get batched together. http://bugzilla.clutter-project.org/show_bug.cgi?id=2220
This commit is contained in:
parent
b2247b10fd
commit
5b6298db10
@ -3015,6 +3015,14 @@ _cogl_material_point_size_equal (CoglMaterial *authority0,
|
|||||||
return authority0->big_state->point_size == authority1->big_state->point_size;
|
return authority0->big_state->point_size == authority1->big_state->point_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_cogl_material_user_shader_equal (CoglMaterial *authority0,
|
||||||
|
CoglMaterial *authority1)
|
||||||
|
{
|
||||||
|
return (authority0->big_state->user_program ==
|
||||||
|
authority1->big_state->user_program);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_cogl_material_layers_equal (CoglMaterial *authority0,
|
_cogl_material_layers_equal (CoglMaterial *authority0,
|
||||||
CoglMaterial *authority1)
|
CoglMaterial *authority1)
|
||||||
@ -3244,6 +3252,12 @@ _cogl_material_equal (CoglMaterial *material0,
|
|||||||
_cogl_material_point_size_equal))
|
_cogl_material_point_size_equal))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (!simple_property_equal (material0, material1,
|
||||||
|
materials_difference,
|
||||||
|
COGL_MATERIAL_STATE_USER_SHADER,
|
||||||
|
_cogl_material_user_shader_equal))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!simple_property_equal (material0, material1,
|
if (!simple_property_equal (material0, material1,
|
||||||
materials_difference,
|
materials_difference,
|
||||||
COGL_MATERIAL_STATE_LAYERS,
|
COGL_MATERIAL_STATE_LAYERS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user