_cogl_pipeline_backend_glsl_pre_change_notify,
NULL, /* pipeline_set_parent_notify */
_cogl_pipeline_backend_glsl_layer_pre_change_notify,
- _cogl_pipeline_backend_glsl_free_priv,
- NULL /* free_layer_priv */
+ _cogl_pipeline_backend_glsl_free_priv
};
#endif /* COGL_PIPELINE_BACKEND_GLSL */
/* The lowest index is blended first then others on top */
int index;
- /* Different pipeline backends (GLSL/ARBfp/Fixed Function) may
- * want to associate private data with a layer...
- *
- * NB: we have per backend pointers because a layer may be
- * associated with multiple pipelines with different backends.
- */
- void *backend_priv[COGL_PIPELINE_N_BACKENDS];
-
/* A mask of which state groups are different in this layer
* in comparison to its parent. */
unsigned long differences;
CoglPipelineLayerState change);
void (*free_priv) (CoglPipeline *pipeline);
- void (*free_layer_priv) (CoglPipelineLayer *layer);
} CoglPipelineBackend;
typedef enum
_cogl_pipeline_layer_copy (CoglPipelineLayer *src)
{
CoglPipelineLayer *layer = g_slice_new (CoglPipelineLayer);
- int i;
_cogl_pipeline_node_init (COGL_PIPELINE_NODE (layer));
layer->differences = 0;
layer->has_big_state = FALSE;
- for (i = 0; i < COGL_PIPELINE_N_BACKENDS; i++)
- layer->backend_priv[i] = NULL;
-
_cogl_pipeline_layer_set_parent (layer, src);
return _cogl_pipeline_layer_object_new (layer);
static void
_cogl_pipeline_layer_free (CoglPipelineLayer *layer)
{
- int i;
-
_cogl_pipeline_layer_unparent (COGL_PIPELINE_NODE (layer));
- /* NB: layers may be used by multiple pipelines which may be using
- * different backends, therefore we determine which backends to
- * notify based on the private state pointers for each backend...
- */
- for (i = 0; i < COGL_PIPELINE_N_BACKENDS; i++)
- {
- if (layer->backend_priv[i] &&
- _cogl_pipeline_backends[i]->free_layer_priv)
- {
- const CoglPipelineBackend *backend = _cogl_pipeline_backends[i];
- backend->free_layer_priv (layer);
- }
- }
-
if (layer->differences & COGL_PIPELINE_LAYER_STATE_TEXTURE &&
layer->texture != COGL_INVALID_HANDLE)
cogl_handle_unref (layer->texture);
CoglPipelineLayerBigState *big_state =
g_slice_new0 (CoglPipelineLayerBigState);
CoglPipelineLayer *new;
- int i;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
layer->index = 0;
- for (i = 0; i < COGL_PIPELINE_N_BACKENDS; i++)
- layer->backend_priv[i] = NULL;
-
layer->differences = COGL_PIPELINE_LAYER_STATE_ALL_SPARSE;
layer->unit_index = 0;