[Cogl] [PATCH] pipeline: remove dubious optimization

Robert Bragg robert at sixbynine.org
Tue Sep 25 13:18:25 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

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.
---
 cogl/cogl-pipeline.c |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index 3f7f941..4328a70 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -1076,24 +1076,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.
-- 
1.7.7.6



More information about the Cogl mailing list