From 5b6298db102327bc10c3deecaafe465150e505e1 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Sat, 17 Jul 2010 14:08:28 +0100 Subject: [PATCH] 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 --- cogl/cogl-material.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cogl/cogl-material.c b/cogl/cogl-material.c index f266105cb..981837228 100644 --- a/cogl/cogl-material.c +++ b/cogl/cogl-material.c @@ -3015,6 +3015,14 @@ _cogl_material_point_size_equal (CoglMaterial *authority0, 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 _cogl_material_layers_equal (CoglMaterial *authority0, CoglMaterial *authority1) @@ -3244,6 +3252,12 @@ _cogl_material_equal (CoglMaterial *material0, _cogl_material_point_size_equal)) 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, materials_difference, COGL_MATERIAL_STATE_LAYERS,