From 6712aaef45bd8e27871e9c4b594b5efd51d69451 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 21 Sep 2012 16:59:25 +0100 Subject: [PATCH] pipeline: remove dubious optimization This removes an optimization that I added at some point, which I'm pretty certain I only added on a hunch. Reading the description I'm not really convinced it makes sense to do this given that the fixed vertend and fragend are currently listed before the glsl vertend and fragend in the order that we look for a suitable backend. This means unless the pipeline depends on glsl (e.g. due to an associated snippet) we would reselect the fixed backend anyway, and if it really did depend on glsl then we'd notice when we come to flush and switch backends there any way. Reviewed-by: Neil Roberts (cherry picked from commit 071698d2c017af33e41b838429d514f5df5e02a1) --- cogl/cogl-pipeline.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c index f07126122..1a8036f5b 100644 --- a/cogl/cogl-pipeline.c +++ b/cogl/cogl-pipeline.c @@ -1185,24 +1185,6 @@ _cogl_pipeline_pre_change_notify (CoglPipeline *pipeline, } } - /* The fixed function backend has no private state and can't - * do anything special to handle small pipeline changes so we may as - * well try to find a better backend whenever the pipeline changes. - * - * The programmable backends may be able to cache a lot of the code - * they generate and only need to update a small section of that - * code in response to a pipeline change therefore we don't want to - * try searching for another backend when the pipeline changes. - */ -#ifdef COGL_PIPELINE_FRAGEND_FIXED - if (pipeline->fragend == COGL_PIPELINE_FRAGEND_FIXED) - _cogl_pipeline_set_fragend (pipeline, COGL_PIPELINE_FRAGEND_UNDEFINED); -#endif -#ifdef COGL_PIPELINE_VERTEND_FIXED - if (pipeline->vertend == COGL_PIPELINE_VERTEND_FIXED) - _cogl_pipeline_set_vertend (pipeline, COGL_PIPELINE_VERTEND_UNDEFINED); -#endif - /* XXX: * To simplify things for the vertex, fragment and program backends * we are careful about how we report STATE_LAYERS changes.