diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c index 0466740d3..140a488be 100644 --- a/cogl/cogl-pipeline.c +++ b/cogl/cogl-pipeline.c @@ -1615,8 +1615,7 @@ _cogl_pipeline_get_layer (CoglPipeline *pipeline, CoglPipelineLayer *layer; int unit_index; int i; - - _COGL_GET_CONTEXT (ctx, NULL); + CoglContext *ctx; /* The layer index of the layer we want info about */ layer_info.layer_index = layer_index; @@ -1645,6 +1644,8 @@ _cogl_pipeline_get_layer (CoglPipeline *pipeline, if (layer_info.layer) return layer_info.layer; + ctx = _cogl_context_get_default (); + unit_index = layer_info.insert_after + 1; if (unit_index == 0) layer = _cogl_pipeline_layer_copy (ctx->default_layer_0);