pipeline: only maintain breadcrumb for debug builds
This ensures we only add a static_breadcrumb pointer to every CoglPipeline when build with debugging enabled. Since applications may allocate a lot of pipelines we want to keep the basic size of pipelines (ignoring optional sparse state) down to a minimum. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 4716312e14bc253cd174a22b3db9d2c9cf031fa1)
This commit is contained in:
@ -423,7 +423,9 @@ cogl_pipeline_new (CoglContext *context)
|
||||
CoglPipeline *new;
|
||||
|
||||
new = cogl_pipeline_copy (context->default_pipeline);
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
_cogl_pipeline_set_static_breadcrumb (new, "new");
|
||||
#endif
|
||||
return new;
|
||||
}
|
||||
|
||||
@ -1364,8 +1366,10 @@ _cogl_pipeline_pre_change_notify (CoglPipeline *pipeline,
|
||||
|
||||
new_authority =
|
||||
cogl_pipeline_copy (_cogl_pipeline_get_parent (pipeline));
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
_cogl_pipeline_set_static_breadcrumb (new_authority,
|
||||
"pre_change_notify:copy-on-write");
|
||||
#endif
|
||||
|
||||
/* We could explicitly walk the descendants, OR together the set
|
||||
* of differences that we determine this pipeline is the
|
||||
@ -2579,6 +2583,7 @@ _cogl_pipeline_journal_unref (CoglPipeline *pipeline)
|
||||
cogl_object_unref (pipeline);
|
||||
}
|
||||
|
||||
#ifdef COGL_DEBUG_ENABLED
|
||||
void
|
||||
_cogl_pipeline_apply_legacy_state (CoglPipeline *pipeline)
|
||||
{
|
||||
@ -2620,6 +2625,7 @@ _cogl_pipeline_set_static_breadcrumb (CoglPipeline *pipeline,
|
||||
pipeline->has_static_breadcrumb = TRUE;
|
||||
pipeline->static_breadcrumb = breadcrumb;
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef void (*LayerStateHashFunction) (CoglPipelineLayer *authority,
|
||||
CoglPipelineLayer **authorities,
|
||||
|
Reference in New Issue
Block a user