$(srcdir)/cogl-pipeline-private.h \
$(srcdir)/cogl-pipeline-opengl.c \
$(srcdir)/cogl-pipeline-opengl-private.h \
- $(srcdir)/cogl-pipeline-glsl.c \
- $(srcdir)/cogl-pipeline-glsl-private.h \
- $(srcdir)/cogl-pipeline-arbfp.c \
- $(srcdir)/cogl-pipeline-arbfp-private.h \
- $(srcdir)/cogl-pipeline-fixed.c \
- $(srcdir)/cogl-pipeline-fixed-private.h \
+ $(srcdir)/cogl-pipeline-fragend-glsl.c \
+ $(srcdir)/cogl-pipeline-fragend-glsl-private.h \
+ $(srcdir)/cogl-pipeline-fragend-arbfp.c \
+ $(srcdir)/cogl-pipeline-fragend-arbfp-private.h \
+ $(srcdir)/cogl-pipeline-fragend-fixed.c \
+ $(srcdir)/cogl-pipeline-fragend-fixed-private.h \
$(srcdir)/cogl-material-compat.c \
$(srcdir)/cogl-program.c \
$(srcdir)/cogl-program-private.h \
#include <string.h>
#ifdef HAVE_COGL_GL
-#include "cogl-pipeline-arbfp-private.h"
+#include "cogl-pipeline-fragend-arbfp-private.h"
#define glActiveTexture _context->drv.pf_glActiveTexture
#endif
_context->legacy_depth_test_enabled = FALSE;
#ifdef HAVE_COGL_GL
- _context->arbfp_cache = g_hash_table_new (_cogl_pipeline_arbfp_hash,
- _cogl_pipeline_arbfp_equal);
+ _context->arbfp_cache = g_hash_table_new (_cogl_pipeline_fragend_arbfp_hash,
+ _cogl_pipeline_fragend_arbfp_equal);
#endif
for (i = 0; i < COGL_BUFFER_BIND_TARGET_COUNT; i++)
* Robert Bragg <robert@linux.intel.com>
*/
-#ifndef __COGL_PIPELINE_ARBFP_PRIVATE_H
-#define __COGL_PIPELINE_ARBFP_PRIVATE_H
+#ifndef __COGL_PIPELINE_FRAGEND_ARBFP_PRIVATE_H
+#define __COGL_PIPELINE_FRAGEND_ARBFP_PRIVATE_H
#include "cogl-pipeline-private.h"
-extern const CoglPipelineBackend _cogl_pipeline_arbfp_backend;
+extern const CoglPipelineFragend _cogl_pipeline_arbfp_fragend;
unsigned int
-_cogl_pipeline_arbfp_hash (const void *pipeline);
+_cogl_pipeline_fragend_arbfp_hash (const void *pipeline);
gboolean
-_cogl_pipeline_arbfp_equal (const void *pipeline0, const void *pipeline1);
+_cogl_pipeline_fragend_arbfp_equal (const void *pipeline0,
+ const void *pipeline1);
#endif /* __COGL_PIPELINE_ARBFP_PRIVATE_H */
#include "cogl-debug.h"
#include "cogl-pipeline-private.h"
-#ifdef COGL_PIPELINE_BACKEND_ARBFP
+#ifdef COGL_PIPELINE_FRAGEND_ARBFP
#include "cogl.h"
#include "cogl-internal.h"
* code generation.
*/
-#define COGL_PIPELINE_ARBFP_FRAGMENT_STATE_MASK \
+#define COGL_PIPELINE_FRAGEND_ARBFP_FRAGMENT_STATE_MASK \
(COGL_PIPELINE_STATE_LAYERS | \
COGL_PIPELINE_STATE_USER_SHADER)
-#define COGL_PIPELINE_ARBFP_FRAGMENT_PROGRAM_STATE_MASK \
- COGL_PIPELINE_ARBFP_FRAGMENT_STATE_MASK
+#define COGL_PIPELINE_FRAGEND_ARBFP_FRAGMENT_PROGRAM_STATE_MASK \
+ COGL_PIPELINE_FRAGEND_ARBFP_FRAGMENT_STATE_MASK
-#define COGL_PIPELINE_ARBFP_LAYER_FRAGMENT_STATE_MASK \
+#define COGL_PIPELINE_FRAGEND_ARBFP_LAYER_FRAGMENT_STATE_MASK \
COGL_PIPELINE_LAYER_STATE_ALL
-#define COGL_PIPELINE_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK \
- (COGL_PIPELINE_ARBFP_LAYER_FRAGMENT_STATE_MASK & \
+#define COGL_PIPELINE_FRAGEND_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK \
+ (COGL_PIPELINE_FRAGEND_ARBFP_LAYER_FRAGMENT_STATE_MASK & \
~(COGL_PIPELINE_LAYER_STATE_COMBINE_CONSTANT | \
COGL_PIPELINE_LAYER_STATE_FILTERS | \
COGL_PIPELINE_LAYER_STATE_WRAP_MODES | \
CoglPipeline *last_used_for_pipeline;
} ArbfpProgramState;
-typedef struct _CoglPipelineBackendARBfpPrivate
+typedef struct _CoglPipelineFragendARBfpPrivate
{
ArbfpProgramState *arbfp_program_state;
-} CoglPipelineBackendARBfpPrivate;
+} CoglPipelineFragendARBfpPrivate;
-const CoglPipelineBackend _cogl_pipeline_arbfp_backend;
+const CoglPipelineFragend _cogl_pipeline_arbfp_fragend;
static ArbfpProgramState *
}
static int
-_cogl_pipeline_backend_arbfp_get_max_texture_units (void)
+_cogl_pipeline_fragend_arbfp_get_max_texture_units (void)
{
return _cogl_get_max_texture_image_units ();
}
-static CoglPipelineBackendARBfpPrivate *
+static CoglPipelineFragendARBfpPrivate *
get_arbfp_priv (CoglPipeline *pipeline)
{
- if (!(pipeline->backend_priv_set_mask & COGL_PIPELINE_BACKEND_ARBFP_MASK))
+ if (!(pipeline->fragend_priv_set_mask & COGL_PIPELINE_FRAGEND_ARBFP_MASK))
return NULL;
- return pipeline->backend_privs[COGL_PIPELINE_BACKEND_ARBFP];
+ return pipeline->fragend_privs[COGL_PIPELINE_FRAGEND_ARBFP];
}
static void
-set_arbfp_priv (CoglPipeline *pipeline, CoglPipelineBackendARBfpPrivate *priv)
+set_arbfp_priv (CoglPipeline *pipeline, CoglPipelineFragendARBfpPrivate *priv)
{
if (priv)
{
- pipeline->backend_privs[COGL_PIPELINE_BACKEND_ARBFP] = priv;
- pipeline->backend_priv_set_mask |= COGL_PIPELINE_BACKEND_ARBFP_MASK;
+ pipeline->fragend_privs[COGL_PIPELINE_FRAGEND_ARBFP] = priv;
+ pipeline->fragend_priv_set_mask |= COGL_PIPELINE_FRAGEND_ARBFP_MASK;
}
else
- pipeline->backend_priv_set_mask &= ~COGL_PIPELINE_BACKEND_ARBFP_MASK;
+ pipeline->fragend_priv_set_mask &= ~COGL_PIPELINE_FRAGEND_ARBFP_MASK;
}
static ArbfpProgramState *
get_arbfp_program_state (CoglPipeline *pipeline)
{
- CoglPipelineBackendARBfpPrivate *priv = get_arbfp_priv (pipeline);
+ CoglPipelineFragendARBfpPrivate *priv = get_arbfp_priv (pipeline);
if (!priv)
return NULL;
return priv->arbfp_program_state;
}
static gboolean
-_cogl_pipeline_backend_arbfp_start (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline,
int n_layers,
unsigned long pipelines_difference,
int n_tex_coord_attribs)
{
- CoglPipelineBackendARBfpPrivate *priv;
+ CoglPipelineFragendARBfpPrivate *priv;
CoglPipeline *authority;
- CoglPipelineBackendARBfpPrivate *authority_priv;
+ CoglPipelineFragendARBfpPrivate *authority_priv;
ArbfpProgramState *arbfp_program_state;
CoglHandle user_program;
priv = get_arbfp_priv (pipeline);
if (!priv)
{
- priv = g_slice_new0 (CoglPipelineBackendARBfpPrivate);
+ priv = g_slice_new0 (CoglPipelineFragendARBfpPrivate);
set_arbfp_priv (pipeline, priv);
}
if (!authority_priv)
{
- authority_priv = g_slice_new0 (CoglPipelineBackendARBfpPrivate);
+ authority_priv = g_slice_new0 (CoglPipelineFragendARBfpPrivate);
set_arbfp_priv (authority, authority_priv);
}
}
unsigned int
-_cogl_pipeline_arbfp_hash (const void *data)
+_cogl_pipeline_fragend_arbfp_hash (const void *data)
{
unsigned long fragment_state =
- COGL_PIPELINE_ARBFP_FRAGMENT_PROGRAM_STATE_MASK;
+ COGL_PIPELINE_FRAGEND_ARBFP_FRAGMENT_PROGRAM_STATE_MASK;
unsigned long layer_fragment_state =
- COGL_PIPELINE_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK;
+ COGL_PIPELINE_FRAGEND_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK;
CoglPipelineEvalFlags flags = COGL_PIPELINE_EVAL_FLAG_IGNORE_TEXTURE_DATA;
return _cogl_pipeline_hash ((CoglPipeline *)data,
}
gboolean
-_cogl_pipeline_arbfp_equal (const void *a, const void *b)
+_cogl_pipeline_fragend_arbfp_equal (const void *a, const void *b)
{
unsigned long fragment_state =
- COGL_PIPELINE_ARBFP_FRAGMENT_PROGRAM_STATE_MASK;
+ COGL_PIPELINE_FRAGEND_ARBFP_FRAGMENT_PROGRAM_STATE_MASK;
unsigned long layer_fragment_state =
- COGL_PIPELINE_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK;
+ COGL_PIPELINE_FRAGEND_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK;
CoglPipelineEvalFlags flags = COGL_PIPELINE_EVAL_FLAG_IGNORE_TEXTURE_DATA;
return _cogl_pipeline_equal ((CoglPipeline *)a, (CoglPipeline *)b,
}
}
-typedef enum _CoglPipelineBackendARBfpArgType
+typedef enum _CoglPipelineFragendARBfpArgType
{
- COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_SIMPLE,
- COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_CONSTANT,
- COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_TEXTURE
-} CoglPipelineBackendARBfpArgType;
+ COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_SIMPLE,
+ COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_CONSTANT,
+ COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_TEXTURE
+} CoglPipelineFragendARBfpArgType;
-typedef struct _CoglPipelineBackendARBfpArg
+typedef struct _CoglPipelineFragendARBfpArg
{
const char *name;
- CoglPipelineBackendARBfpArgType type;
+ CoglPipelineFragendARBfpArgType type;
/* for type = TEXTURE */
int texture_unit;
const char *swizzle;
-} CoglPipelineBackendARBfpArg;
+} CoglPipelineFragendARBfpArg;
static void
-append_arg (GString *source, const CoglPipelineBackendARBfpArg *arg)
+append_arg (GString *source, const CoglPipelineFragendARBfpArg *arg)
{
switch (arg->type)
{
- case COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_TEXTURE:
+ case COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_TEXTURE:
g_string_append_printf (source, "texel%d%s",
arg->texture_unit, arg->swizzle);
break;
- case COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_CONSTANT:
+ case COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_CONSTANT:
g_string_append_printf (source, "program.local[%d]%s",
arg->constant_id, arg->swizzle);
break;
- case COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_SIMPLE:
+ case COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_SIMPLE:
g_string_append_printf (source, "%s%s",
arg->name, arg->swizzle);
break;
/* Note: we are trying to avoid duplicating strings during codegen
* which is why we have the slightly awkward
- * CoglPipelineBackendARBfpArg mechanism. */
+ * CoglPipelineFragendARBfpArg mechanism. */
static void
setup_arg (CoglPipeline *pipeline,
CoglPipelineLayer *layer,
int arg_index,
GLint src,
GLint op,
- CoglPipelineBackendARBfpArg *arg)
+ CoglPipelineFragendARBfpArg *arg)
{
ArbfpProgramState *arbfp_program_state = get_arbfp_program_state (pipeline);
static const char *tmp_name[3] = { "tmp0", "tmp1", "tmp2" };
switch (src)
{
case GL_TEXTURE:
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_TEXTURE;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_TEXTURE;
arg->name = "texel%d";
arg->texture_unit = _cogl_pipeline_layer_get_unit_index (layer);
texture = _cogl_pipeline_layer_get_texture (layer);
unit_state->constant_id = arbfp_program_state->next_constant_id++;
unit_state->dirty_combine_constant = TRUE;
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_CONSTANT;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_CONSTANT;
arg->name = "program.local[%d]";
arg->constant_id = unit_state->constant_id;
break;
}
case GL_PRIMARY_COLOR:
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_SIMPLE;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_SIMPLE;
arg->name = "fragment.color.primary";
break;
case GL_PREVIOUS:
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_SIMPLE;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_SIMPLE;
if (_cogl_pipeline_layer_get_unit_index (layer) == 0)
arg->name = "fragment.color.primary";
else
arg->name = "output";
break;
default: /* GL_TEXTURE0..N */
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_TEXTURE;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_TEXTURE;
arg->name = "texture[%d]";
arg->texture_unit = src - GL_TEXTURE0;
texture = _cogl_pipeline_layer_get_texture (layer);
arg_index);
append_arg (arbfp_program_state->source, arg);
g_string_append_printf (arbfp_program_state->source, ";\n");
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_SIMPLE;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_SIMPLE;
arg->name = tmp_name[arg_index];
arg->swizzle = "";
break;
g_string_append_printf (arbfp_program_state->source, ".a;\n");
else
g_string_append_printf (arbfp_program_state->source, ";\n");
- arg->type = COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_SIMPLE;
+ arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_SIMPLE;
arg->name = tmp_name[arg_index];
break;
default:
}
static gboolean
-backend_arbfp_args_equal (CoglPipelineBackendARBfpArg *arg0,
- CoglPipelineBackendARBfpArg *arg1)
+fragend_arbfp_args_equal (CoglPipelineFragendARBfpArg *arg0,
+ CoglPipelineFragendARBfpArg *arg1)
{
if (arg0->type != arg1->type)
return FALSE;
strcmp (arg0->name, arg1->name) != 0)
return FALSE;
- if (arg0->type == COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_TEXTURE &&
+ if (arg0->type == COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_TEXTURE &&
arg0->texture_unit != arg1->texture_unit)
return FALSE;
/* Note we don't have to check the target; a texture unit can only
* have one target enabled at a time. */
- if (arg0->type == COGL_PIPELINE_BACKEND_ARBFP_ARG_TYPE_CONSTANT &&
+ if (arg0->type == COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_CONSTANT &&
arg0->constant_id != arg0->constant_id)
return FALSE;
append_function (CoglPipeline *pipeline,
CoglBlendStringChannelMask mask,
GLint function,
- CoglPipelineBackendARBfpArg *args,
+ CoglPipelineFragendARBfpArg *args,
int n_args)
{
ArbfpProgramState *arbfp_program_state = get_arbfp_program_state (pipeline);
append_arg (arbfp_program_state->source, &args[0]);
g_string_append (arbfp_program_state->source, ", minus_one;\n");
- if (!backend_arbfp_args_equal (&args[0], &args[1]))
+ if (!fragend_arbfp_args_equal (&args[0], &args[1]))
{
g_string_append (arbfp_program_state->source, "MAD tmp4, two, ");
append_arg (arbfp_program_state->source, &args[1]);
{
int i;
int n_args;
- CoglPipelineBackendARBfpArg args[3];
+ CoglPipelineFragendARBfpArg args[3];
n_args = _cogl_get_n_args_for_combine_func (function);
}
static gboolean
-_cogl_pipeline_backend_arbfp_add_layer (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
CoglPipelineLayer *layer,
unsigned long layers_difference)
{
}
gboolean
-_cogl_pipeline_backend_arbfp_passthrough (CoglPipeline *pipeline)
+_cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
{
ArbfpProgramState *arbfp_program_state = get_arbfp_program_state (pipeline);
}
static gboolean
-_cogl_pipeline_backend_arbfp_end (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
unsigned long pipelines_difference)
{
ArbfpProgramState *arbfp_program_state = get_arbfp_program_state (pipeline);
if (arbfp_program_state->source)
{
GLenum gl_error;
- COGL_STATIC_COUNTER (backend_arbfp_compile_counter,
+ COGL_STATIC_COUNTER (fragend_arbfp_compile_counter,
"arbfp compile counter",
"Increments each time a new ARBfp "
"program is compiled",
0 /* no application private data */);
- COGL_COUNTER_INC (_cogl_uprof_context, backend_arbfp_compile_counter);
+ COGL_COUNTER_INC (_cogl_uprof_context, fragend_arbfp_compile_counter);
g_string_append (arbfp_program_state->source,
"MOV result.color,output;\n");
* with a pre-calculated hash value since there is a cost to
* calculating the hash of a CoglPipeline and in this case
* we know we have already called _cogl_pipeline_hash during
- * _cogl_pipeline_arbfp_backend_start so we could pass the
+ * _cogl_pipeline_fragend_arbfp_backend_start so we could pass the
* value through to here to avoid hashing it again.
*/
static void
dirty_arbfp_program_state (CoglPipeline *pipeline)
{
- CoglPipelineBackendARBfpPrivate *priv;
+ CoglPipelineFragendARBfpPrivate *priv;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
}
static void
-_cogl_pipeline_backend_arbfp_pipeline_pre_change_notify (
+_cogl_pipeline_fragend_arbfp_pipeline_pre_change_notify (
CoglPipeline *pipeline,
CoglPipelineState change,
const CoglColor *new_color)
{
- if (!(change & COGL_PIPELINE_ARBFP_FRAGMENT_PROGRAM_STATE_MASK))
+ if (!(change & COGL_PIPELINE_FRAGEND_ARBFP_FRAGMENT_PROGRAM_STATE_MASK))
return;
dirty_arbfp_program_state (pipeline);
* yet!
*/
static void
-_cogl_pipeline_backend_arbfp_layer_pre_change_notify (
+_cogl_pipeline_fragend_arbfp_layer_pre_change_notify (
CoglPipeline *owner,
CoglPipelineLayer *layer,
CoglPipelineLayerState change)
{
- CoglPipelineBackendARBfpPrivate *priv = get_arbfp_priv (owner);
+ CoglPipelineFragendARBfpPrivate *priv = get_arbfp_priv (owner);
if (!priv)
return;
- if (change & COGL_PIPELINE_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK)
+ if (change & COGL_PIPELINE_FRAGEND_ARBFP_LAYER_FRAGMENT_PROGRAM_STATE_MASK)
{
dirty_arbfp_program_state (owner);
return;
}
static void
-_cogl_pipeline_backend_arbfp_free_priv (CoglPipeline *pipeline)
+_cogl_pipeline_fragend_arbfp_free_priv (CoglPipeline *pipeline)
{
- CoglPipelineBackendARBfpPrivate *priv = get_arbfp_priv (pipeline);
+ CoglPipelineFragendARBfpPrivate *priv = get_arbfp_priv (pipeline);
if (priv)
{
if (priv->arbfp_program_state)
arbfp_program_state_unref (priv->arbfp_program_state);
- g_slice_free (CoglPipelineBackendARBfpPrivate, priv);
+ g_slice_free (CoglPipelineFragendARBfpPrivate, priv);
set_arbfp_priv (pipeline, NULL);
}
}
-const CoglPipelineBackend _cogl_pipeline_arbfp_backend =
+const CoglPipelineFragend _cogl_pipeline_arbfp_fragend =
{
- _cogl_pipeline_backend_arbfp_get_max_texture_units,
- _cogl_pipeline_backend_arbfp_start,
- _cogl_pipeline_backend_arbfp_add_layer,
- _cogl_pipeline_backend_arbfp_passthrough,
- _cogl_pipeline_backend_arbfp_end,
- _cogl_pipeline_backend_arbfp_pipeline_pre_change_notify,
+ _cogl_pipeline_fragend_arbfp_get_max_texture_units,
+ _cogl_pipeline_fragend_arbfp_start,
+ _cogl_pipeline_fragend_arbfp_add_layer,
+ _cogl_pipeline_fragend_arbfp_passthrough,
+ _cogl_pipeline_fragend_arbfp_end,
+ _cogl_pipeline_fragend_arbfp_pipeline_pre_change_notify,
NULL,
- _cogl_pipeline_backend_arbfp_layer_pre_change_notify,
- _cogl_pipeline_backend_arbfp_free_priv,
+ _cogl_pipeline_fragend_arbfp_layer_pre_change_notify,
+ _cogl_pipeline_fragend_arbfp_free_priv
};
-#endif /* COGL_PIPELINE_BACKEND_ARBFP */
+#endif /* COGL_PIPELINE_FRAGEND_ARBFP */
* Robert Bragg <robert@linux.intel.com>
*/
-#ifndef __COGL_PIPELINE_FIXED_PRIVATE_H
-#define __COGL_PIPELINE_FIXED_PRIVATE_H
+#ifndef __COGL_PIPELINE_FRAGEND_FIXED_PRIVATE_H
+#define __COGL_PIPELINE_FRAGEND_FIXED_PRIVATE_H
#include "cogl-pipeline-private.h"
-extern const CoglPipelineBackend _cogl_pipeline_fixed_backend;
+extern const CoglPipelineFragend _cogl_pipeline_fixed_fragend;
-#endif /* __COGL_PIPELINE_FIXED_PRIVATE_H */
+#endif /* __COGL_PIPELINE_FRAGEND_FIXED_PRIVATE_H */
#include "cogl-pipeline-private.h"
#include "cogl-pipeline-opengl-private.h"
-#ifdef COGL_PIPELINE_BACKEND_FIXED
+#ifdef COGL_PIPELINE_FRAGEND_FIXED
#include "cogl.h"
#include "cogl-internal.h"
#include <glib/gprintf.h>
#include <string.h>
-const CoglPipelineBackend _cogl_pipeline_fixed_backend;
+const CoglPipelineFragend _cogl_pipeline_fixed_fragend;
static int
-_cogl_pipeline_backend_fixed_get_max_texture_units (void)
+_cogl_pipeline_fragend_fixed_get_max_texture_units (void)
{
_COGL_GET_CONTEXT (ctx, 0);
}
static gboolean
-_cogl_pipeline_backend_fixed_start (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_fixed_start (CoglPipeline *pipeline,
int n_layers,
unsigned long pipelines_difference,
int n_tex_coord_attribs)
}
static gboolean
-_cogl_pipeline_backend_fixed_add_layer (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
CoglPipelineLayer *layer,
unsigned long layers_difference)
{
}
static gboolean
-_cogl_pipeline_backend_fixed_end (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_fixed_end (CoglPipeline *pipeline,
unsigned long pipelines_difference)
{
if (pipelines_difference & COGL_PIPELINE_STATE_FOG)
return TRUE;
}
-const CoglPipelineBackend _cogl_pipeline_fixed_backend =
+const CoglPipelineFragend _cogl_pipeline_fixed_fragend =
{
- _cogl_pipeline_backend_fixed_get_max_texture_units,
- _cogl_pipeline_backend_fixed_start,
- _cogl_pipeline_backend_fixed_add_layer,
+ _cogl_pipeline_fragend_fixed_get_max_texture_units,
+ _cogl_pipeline_fragend_fixed_start,
+ _cogl_pipeline_fragend_fixed_add_layer,
NULL, /* passthrough */
- _cogl_pipeline_backend_fixed_end,
+ _cogl_pipeline_fragend_fixed_end,
NULL, /* pipeline_change_notify */
NULL, /* pipeline_set_parent_notify */
NULL, /* layer_change_notify */
NULL /* free_priv */
};
-#endif /* COGL_PIPELINE_BACKEND_FIXED */
+#endif /* COGL_PIPELINE_FRAGEND_FIXED */
* Robert Bragg <robert@linux.intel.com>
*/
-#ifndef __COGL_PIPELINE_GLSL_PRIVATE_H
-#define __COGL_PIPELINE_GLSL_PRIVATE_H
+#ifndef __COGL_PIPELINE_FRAGEND_GLSL_PRIVATE_H
+#define __COGL_PIPELINE_FRAGEND_GLSL_PRIVATE_H
#include "cogl-pipeline-private.h"
-extern const CoglPipelineBackend _cogl_pipeline_glsl_backend;
+extern const CoglPipelineFragend _cogl_pipeline_glsl_fragend;
-#endif /* __COGL_PIPELINE_GLSL_PRIVATE_H */
+#endif /* __COGL_PIPELINE_FRAGEND_GLSL_PRIVATE_H */
#include "cogl-shader-private.h"
#include "cogl-blend-string.h"
-#ifdef COGL_PIPELINE_BACKEND_GLSL
+#ifdef COGL_PIPELINE_FRAGEND_GLSL
#include "cogl.h"
#include "cogl-internal.h"
CoglPipeline *last_used_for_pipeline;
} GlslProgramState;
-typedef struct _CoglPipelineBackendGlslPrivate
+typedef struct _CoglPipelineFragendGlslPrivate
{
GlslProgramState *glsl_program_state;
-} CoglPipelineBackendGlslPrivate;
+} CoglPipelineFragendGlslPrivate;
-const CoglPipelineBackend _cogl_pipeline_glsl_backend;
+const CoglPipelineFragend _cogl_pipeline_glsl_backend;
static int
-_cogl_pipeline_backend_glsl_get_max_texture_units (void)
+_cogl_pipeline_fragend_glsl_get_max_texture_units (void)
{
return _cogl_get_max_texture_image_units ();
}
}
}
-static CoglPipelineBackendGlslPrivate *
+static CoglPipelineFragendGlslPrivate *
get_glsl_priv (CoglPipeline *pipeline)
{
- if (!(pipeline->backend_priv_set_mask & COGL_PIPELINE_BACKEND_GLSL_MASK))
+ if (!(pipeline->fragend_priv_set_mask & COGL_PIPELINE_FRAGEND_GLSL_MASK))
return NULL;
- return pipeline->backend_privs[COGL_PIPELINE_BACKEND_GLSL];
+ return pipeline->fragend_privs[COGL_PIPELINE_FRAGEND_GLSL];
}
static void
-set_glsl_priv (CoglPipeline *pipeline, CoglPipelineBackendGlslPrivate *priv)
+set_glsl_priv (CoglPipeline *pipeline, CoglPipelineFragendGlslPrivate *priv)
{
if (priv)
{
- pipeline->backend_privs[COGL_PIPELINE_BACKEND_GLSL] = priv;
- pipeline->backend_priv_set_mask |= COGL_PIPELINE_BACKEND_GLSL_MASK;
+ pipeline->fragend_privs[COGL_PIPELINE_FRAGEND_GLSL] = priv;
+ pipeline->fragend_priv_set_mask |= COGL_PIPELINE_FRAGEND_GLSL_MASK;
}
else
- pipeline->backend_priv_set_mask &= ~COGL_PIPELINE_BACKEND_GLSL_MASK;
+ pipeline->fragend_priv_set_mask &= ~COGL_PIPELINE_FRAGEND_GLSL_MASK;
}
static GlslProgramState *
get_glsl_program_state (CoglPipeline *pipeline)
{
- CoglPipelineBackendGlslPrivate *priv = get_glsl_priv (pipeline);
+ CoglPipelineFragendGlslPrivate *priv = get_glsl_priv (pipeline);
if (!priv)
return NULL;
return priv->glsl_program_state;
static void
dirty_glsl_program_state (CoglPipeline *pipeline)
{
- CoglPipelineBackendGlslPrivate *priv;
+ CoglPipelineFragendGlslPrivate *priv;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
}
static gboolean
-_cogl_pipeline_backend_glsl_start (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_glsl_start (CoglPipeline *pipeline,
int n_layers,
unsigned long pipelines_difference,
int n_tex_coord_attribs)
{
- CoglPipelineBackendGlslPrivate *priv;
+ CoglPipelineFragendGlslPrivate *priv;
CoglPipeline *authority;
- CoglPipelineBackendGlslPrivate *authority_priv;
+ CoglPipelineFragendGlslPrivate *authority_priv;
CoglProgram *user_program;
GSList *l;
int i;
priv = get_glsl_priv (pipeline);
if (!priv)
{
- priv = g_slice_new0 (CoglPipelineBackendGlslPrivate);
+ priv = g_slice_new0 (CoglPipelineFragendGlslPrivate);
set_glsl_priv (pipeline, priv);
}
authority_priv = get_glsl_priv (authority);
if (!authority_priv)
{
- authority_priv = g_slice_new0 (CoglPipelineBackendGlslPrivate);
+ authority_priv = g_slice_new0 (CoglPipelineFragendGlslPrivate);
set_glsl_priv (authority, authority_priv);
}
}
static gboolean
-_cogl_pipeline_backend_glsl_add_layer (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_glsl_add_layer (CoglPipeline *pipeline,
CoglPipelineLayer *layer,
unsigned long layers_difference)
{
}
gboolean
-_cogl_pipeline_backend_glsl_passthrough (CoglPipeline *pipeline)
+_cogl_pipeline_fragend_glsl_passthrough (CoglPipeline *pipeline)
{
GlslProgramState *glsl_program_state = get_glsl_program_state (pipeline);
#endif /* HAVE_COGL_GLES2 */
gboolean
-_cogl_pipeline_backend_glsl_end (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline,
unsigned long pipelines_difference)
{
GlslProgramState *glsl_program_state = get_glsl_program_state (pipeline);
GLint compile_status;
GLuint shader;
- COGL_STATIC_COUNTER (backend_glsl_compile_counter,
+ COGL_STATIC_COUNTER (fragend_glsl_compile_counter,
"glsl compile counter",
"Increments each time a new GLSL "
"program is compiled",
0 /* no application private data */);
- COGL_COUNTER_INC (_cogl_uprof_context, backend_glsl_compile_counter);
+ COGL_COUNTER_INC (_cogl_uprof_context, fragend_glsl_compile_counter);
#ifdef HAVE_COGL_GLES2
add_alpha_test_snippet (pipeline, glsl_program_state);
}
static void
-_cogl_pipeline_backend_glsl_pre_change_notify (CoglPipeline *pipeline,
+_cogl_pipeline_fragend_glsl_pre_change_notify (CoglPipeline *pipeline,
CoglPipelineState change,
const CoglColor *new_color)
{
* yet!
*/
static void
-_cogl_pipeline_backend_glsl_layer_pre_change_notify (
+_cogl_pipeline_fragend_glsl_layer_pre_change_notify (
CoglPipeline *owner,
CoglPipelineLayer *layer,
CoglPipelineLayerState change)
{
- CoglPipelineBackendGlslPrivate *priv;
+ CoglPipelineFragendGlslPrivate *priv;
static const unsigned long not_fragment_op_changes =
COGL_PIPELINE_LAYER_STATE_COMBINE_CONSTANT |
COGL_PIPELINE_LAYER_STATE_TEXTURE |
}
static void
-_cogl_pipeline_backend_glsl_free_priv (CoglPipeline *pipeline)
+_cogl_pipeline_fragend_glsl_free_priv (CoglPipeline *pipeline)
{
- CoglPipelineBackendGlslPrivate *priv = get_glsl_priv (pipeline);
+ CoglPipelineFragendGlslPrivate *priv = get_glsl_priv (pipeline);
if (priv)
{
if (priv->glsl_program_state)
glsl_program_state_unref (priv->glsl_program_state);
- g_slice_free (CoglPipelineBackendGlslPrivate, priv);
+ g_slice_free (CoglPipelineFragendGlslPrivate, priv);
set_glsl_priv (pipeline, NULL);
}
}
-const CoglPipelineBackend _cogl_pipeline_glsl_backend =
+const CoglPipelineFragend _cogl_pipeline_glsl_fragend =
{
- _cogl_pipeline_backend_glsl_get_max_texture_units,
- _cogl_pipeline_backend_glsl_start,
- _cogl_pipeline_backend_glsl_add_layer,
- _cogl_pipeline_backend_glsl_passthrough,
- _cogl_pipeline_backend_glsl_end,
- _cogl_pipeline_backend_glsl_pre_change_notify,
+ _cogl_pipeline_fragend_glsl_get_max_texture_units,
+ _cogl_pipeline_fragend_glsl_start,
+ _cogl_pipeline_fragend_glsl_add_layer,
+ _cogl_pipeline_fragend_glsl_passthrough,
+ _cogl_pipeline_fragend_glsl_end,
+ _cogl_pipeline_fragend_glsl_pre_change_notify,
NULL, /* pipeline_set_parent_notify */
- _cogl_pipeline_backend_glsl_layer_pre_change_notify,
- _cogl_pipeline_backend_glsl_free_priv
+ _cogl_pipeline_fragend_glsl_layer_pre_change_notify,
+ _cogl_pipeline_fragend_glsl_free_priv,
};
-#endif /* COGL_PIPELINE_BACKEND_GLSL */
+#endif /* COGL_PIPELINE_FRAGEND_GLSL */
if (type == COGL_PIPELINE_PROGRAM_TYPE_GLSL)
{
-#ifdef COGL_PIPELINE_BACKEND_GLSL
+#ifdef COGL_PIPELINE_FRAGEND_GLSL
if (ctx->current_gl_program != gl_program)
{
#else
- g_warning ("Unexpected use of GLSL backend!");
+ g_warning ("Unexpected use of GLSL fragend!");
-#endif /* COGL_PIPELINE_BACKEND_GLSL */
+#endif /* COGL_PIPELINE_FRAGEND_GLSL */
}
-#ifndef COGL_PIPELINE_BACKEND_ARBFP
+#ifndef COGL_PIPELINE_FRAGEND_ARBFP
else if (type == COGL_PIPELINE_PROGRAM_TYPE_ARBFP)
- g_warning ("Unexpected use of ARBFP backend!");
-#endif /* COGL_PIPELINE_BACKEND_ARBFP */
+ g_warning ("Unexpected use of ARBFP fragend!");
+#endif /* COGL_PIPELINE_FRAGEND_ARBFP */
ctx->current_use_program_type = type;
}
-#if defined (COGL_PIPELINE_BACKEND_GLSL) || \
- defined (COGL_PIPELINE_BACKEND_ARBFP)
+#if defined (COGL_PIPELINE_FRAGEND_GLSL) || \
+ defined (COGL_PIPELINE_FRAGEND_ARBFP)
int
_cogl_get_max_texture_image_units (void)
{
typedef struct
{
- const CoglPipelineBackend *backend;
+ const CoglPipelineFragend *fragend;
CoglPipeline *pipeline;
unsigned long *layer_differences;
gboolean error_adding_layer;
gboolean added_layer;
-} CoglPipelineBackendAddLayerState;
+} CoglPipelineFragendAddLayerState;
static gboolean
-backend_add_layer_cb (CoglPipelineLayer *layer,
+fragend_add_layer_cb (CoglPipelineLayer *layer,
void *user_data)
{
- CoglPipelineBackendAddLayerState *state = user_data;
- const CoglPipelineBackend *backend = state->backend;
+ CoglPipelineFragendAddLayerState *state = user_data;
+ const CoglPipelineFragend *fragend = state->fragend;
CoglPipeline *pipeline = state->pipeline;
int unit_index = _cogl_pipeline_layer_get_unit_index (layer);
CoglTextureUnit *unit = _cogl_get_texture_unit (unit_index);
if (!unit->enabled)
return FALSE;
- if (G_UNLIKELY (unit_index >= backend->get_max_texture_units ()))
+ if (G_UNLIKELY (unit_index >= fragend->get_max_texture_units ()))
{
int j;
for (j = unit_index; j < ctx->texture_units->len; j++)
/* Either generate per layer code snippets or setup the
* fixed function glTexEnv for each layer... */
- if (G_LIKELY (backend->add_layer (pipeline,
+ if (G_LIKELY (fragend->add_layer (pipeline,
layer,
state->layer_differences[unit_index])))
state->added_layer = TRUE;
* configuration and in that case it will report an error and we
* will fallback to a different backend.
*
- * NB: if pipeline->backend != COGL_PIPELINE_BACKEND_UNDEFINED then
+ * NB: if pipeline->backend != COGL_PIPELINE_FRAGEND_UNDEFINED then
* we have previously managed to successfully flush this pipeline
* with the given backend so we will simply use that to avoid
* fallback code paths.
*/
- if (pipeline->backend == COGL_PIPELINE_BACKEND_UNDEFINED)
- _cogl_pipeline_set_backend (pipeline, COGL_PIPELINE_BACKEND_DEFAULT);
+ if (pipeline->fragend == COGL_PIPELINE_FRAGEND_UNDEFINED)
+ _cogl_pipeline_set_fragend (pipeline, COGL_PIPELINE_FRAGEND_DEFAULT);
- for (i = pipeline->backend;
- i < G_N_ELEMENTS (_cogl_pipeline_backends);
- i++, _cogl_pipeline_set_backend (pipeline, i))
+ for (i = pipeline->fragend;
+ i < G_N_ELEMENTS (_cogl_pipeline_fragends);
+ i++, _cogl_pipeline_set_fragend (pipeline, i))
{
- const CoglPipelineBackend *backend = _cogl_pipeline_backends[i];
- CoglPipelineBackendAddLayerState state;
+ const CoglPipelineFragend *fragend = _cogl_pipeline_fragends[i];
+ CoglPipelineFragendAddLayerState state;
- /* E.g. For backends generating code they can setup their
+ /* E.g. For fragends generating code they can setup their
* scratch buffers here... */
- if (G_UNLIKELY (!backend->start (pipeline,
+ if (G_UNLIKELY (!fragend->start (pipeline,
n_layers,
pipelines_difference,
n_tex_coord_attribs)))
continue;
- state.backend = backend;
+ state.fragend = fragend;
state.pipeline = pipeline;
state.layer_differences = layer_differences;
state.error_adding_layer = FALSE;
state.added_layer = FALSE;
_cogl_pipeline_foreach_layer_internal (pipeline,
- backend_add_layer_cb,
+ fragend_add_layer_cb,
&state);
if (G_UNLIKELY (state.error_adding_layer))
continue;
if (!state.added_layer &&
- backend->passthrough &&
- G_UNLIKELY (!backend->passthrough (pipeline)))
+ fragend->passthrough &&
+ G_UNLIKELY (!fragend->passthrough (pipeline)))
continue;
- /* For backends generating code they may compile and link their
+ /* For fragends generating code they may compile and link their
* programs here, update any uniforms and tell OpenGL to use
* that program.
*/
- if (G_UNLIKELY (!backend->end (pipeline, pipelines_difference)))
+ if (G_UNLIKELY (!fragend->end (pipeline, pipelines_difference)))
continue;
break;
}
- if (G_UNLIKELY (i >= G_N_ELEMENTS (_cogl_pipeline_backends)))
- g_warning ("No usable pipeline backend was found!");
+ if (G_UNLIKELY (i >= G_N_ELEMENTS (_cogl_pipeline_fragends)))
+ g_warning ("No usable pipeline fragment backend was found!");
/* FIXME: This reference is actually resulting in lots of
* copy-on-write reparenting because one-shot pipelines end up
#if defined (HAVE_COGL_GL)
-/* NB: pipeline->backend is currently a 3bit unsigned int bitfield */
-#define COGL_PIPELINE_BACKEND_ARBFP 0
-#define COGL_PIPELINE_BACKEND_ARBFP_MASK (1L<<0)
-#define COGL_PIPELINE_BACKEND_FIXED 1
-#define COGL_PIPELINE_BACKEND_FIXED_MASK (1L<<1)
-#define COGL_PIPELINE_BACKEND_GLSL 2
-#define COGL_PIPELINE_BACKEND_GLSL_MASK (1L<<2)
+/* NB: pipeline->fragend is currently a 3bit unsigned int bitfield */
+#define COGL_PIPELINE_FRAGEND_ARBFP 0
+#define COGL_PIPELINE_FRAGEND_ARBFP_MASK (1L<<0)
+#define COGL_PIPELINE_FRAGEND_FIXED 1
+#define COGL_PIPELINE_FRAGEND_FIXED_MASK (1L<<1)
+#define COGL_PIPELINE_FRAGEND_GLSL 2
+#define COGL_PIPELINE_FRAGEND_GLSL_MASK (1L<<2)
-#define COGL_PIPELINE_N_BACKENDS 3
+#define COGL_PIPELINE_N_FRAGENDS 3
#elif defined (HAVE_COGL_GLES2)
-#define COGL_PIPELINE_BACKEND_GLSL 0
-#define COGL_PIPELINE_BACKEND_GLSL_MASK (1L<<0)
+#define COGL_PIPELINE_FRAGEND_GLSL 0
+#define COGL_PIPELINE_FRAGEND_GLSL_MASK (1L<<0)
-#define COGL_PIPELINE_N_BACKENDS 1
+#define COGL_PIPELINE_N_FRAGENDS 1
#else /* HAVE_COGL_GLES */
-#define COGL_PIPELINE_BACKEND_FIXED 0
-#define COGL_PIPELINE_BACKEND_FIXED_MASK (1L<<0)
+#define COGL_PIPELINE_FRAGEND_FIXED 0
+#define COGL_PIPELINE_FRAGEND_FIXED_MASK (1L<<0)
-#define COGL_PIPELINE_N_BACKENDS 1
+#define COGL_PIPELINE_N_FRAGENDS 1
#endif
-#define COGL_PIPELINE_BACKEND_DEFAULT 0
-#define COGL_PIPELINE_BACKEND_UNDEFINED 3
+#define COGL_PIPELINE_FRAGEND_DEFAULT 0
+#define COGL_PIPELINE_FRAGEND_UNDEFINED 3
/* XXX: should I rename these as
* COGL_PIPELINE_LAYER_STATE_INDEX_XYZ... ?
/* The fragment processing backends can associate private data with a
* pipeline. */
- void *backend_privs[COGL_PIPELINE_N_BACKENDS];
+ void *fragend_privs[COGL_PIPELINE_N_FRAGENDS];
/* Whenever a pipeline is modified we increment the age. There's no
* guarantee that it won't wrap but it can nevertheless be a
* Each set bit indicates if the correspondong ->backend_privs[]
* entry is valid.
*/
- unsigned int backend_priv_set_mask:COGL_PIPELINE_N_BACKENDS;
+ unsigned int fragend_priv_set_mask:COGL_PIPELINE_N_FRAGENDS;
/* Weak pipelines don't count as dependants on their parents which
* means that the parent pipeline can be modified without
* glsl, arbfp and fixed. This identifies the backend being used for
* the pipeline and any private state the backend has associated
* with the pipeline. */
- unsigned int backend:3;
+ unsigned int fragend:3;
};
-typedef struct _CoglPipelineBackend
+typedef struct _CoglPipelineFragend
{
int (*get_max_texture_units) (void);
CoglPipelineLayerState change);
void (*free_priv) (CoglPipeline *pipeline);
-} CoglPipelineBackend;
+} CoglPipelineFragend;
typedef enum
{
COGL_PIPELINE_PROGRAM_TYPE_FIXED
} CoglPipelineProgramType;
-extern const CoglPipelineBackend *
-_cogl_pipeline_backends[COGL_PIPELINE_N_BACKENDS];
+extern const CoglPipelineFragend *
+_cogl_pipeline_fragends[COGL_PIPELINE_N_FRAGENDS];
void
_cogl_pipeline_init_default_pipeline (void);
void *user_data);
void
-_cogl_pipeline_set_backend (CoglPipeline *pipeline, int backend);
+_cogl_pipeline_set_fragend (CoglPipeline *pipeline, int fragend);
CoglPipeline *
_cogl_pipeline_get_parent (CoglPipeline *pipeline);
static void recursively_free_layer_caches (CoglPipeline *pipeline);
static gboolean _cogl_pipeline_is_weak (CoglPipeline *pipeline);
-const CoglPipelineBackend *_cogl_pipeline_backends[COGL_PIPELINE_N_BACKENDS];
+const CoglPipelineFragend *_cogl_pipeline_fragends[COGL_PIPELINE_N_FRAGENDS];
-#ifdef COGL_PIPELINE_BACKEND_GLSL
-#include "cogl-pipeline-glsl-private.h"
+#ifdef COGL_PIPELINE_FRAGEND_GLSL
+#include "cogl-pipeline-fragend-glsl-private.h"
#endif
-#ifdef COGL_PIPELINE_BACKEND_ARBFP
-#include "cogl-pipeline-arbfp-private.h"
+#ifdef COGL_PIPELINE_FRAGEND_ARBFP
+#include "cogl-pipeline-fragend-arbfp-private.h"
#endif
-#ifdef COGL_PIPELINE_BACKEND_FIXED
-#include "cogl-pipeline-fixed-private.h"
+#ifdef COGL_PIPELINE_FRAGEND_FIXED
+#include "cogl-pipeline-fragend-fixed-private.h"
#endif
COGL_OBJECT_DEFINE (Pipeline, pipeline);
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
/* Take this opportunity to setup the fragment processing backends... */
-#ifdef COGL_PIPELINE_BACKEND_GLSL
- _cogl_pipeline_backends[COGL_PIPELINE_BACKEND_GLSL] =
- &_cogl_pipeline_glsl_backend;
+#ifdef COGL_PIPELINE_FRAGEND_GLSL
+ _cogl_pipeline_fragends[COGL_PIPELINE_FRAGEND_GLSL] =
+ &_cogl_pipeline_glsl_fragend;
#endif
-#ifdef COGL_PIPELINE_BACKEND_ARBFP
- _cogl_pipeline_backends[COGL_PIPELINE_BACKEND_ARBFP] =
- &_cogl_pipeline_arbfp_backend;
+#ifdef COGL_PIPELINE_FRAGEND_ARBFP
+ _cogl_pipeline_fragends[COGL_PIPELINE_FRAGEND_ARBFP] =
+ &_cogl_pipeline_arbfp_fragend;
#endif
-#ifdef COGL_PIPELINE_BACKEND_FIXED
- _cogl_pipeline_backends[COGL_PIPELINE_BACKEND_FIXED] =
- &_cogl_pipeline_fixed_backend;
+#ifdef COGL_PIPELINE_FRAGEND_FIXED
+ _cogl_pipeline_fragends[COGL_PIPELINE_FRAGEND_FIXED] =
+ &_cogl_pipeline_fixed_fragend;
#endif
_cogl_pipeline_node_init (COGL_PIPELINE_NODE (pipeline));
pipeline->is_weak = FALSE;
pipeline->journal_ref_count = 0;
- pipeline->backend = COGL_PIPELINE_BACKEND_UNDEFINED;
+ pipeline->fragend = COGL_PIPELINE_FRAGEND_UNDEFINED;
pipeline->differences = COGL_PIPELINE_STATE_ALL_SPARSE;
pipeline->real_blend_enable = FALSE;
* with the pipeline that depends on the pipeline's ancestry then it
* may be notified here...
*/
- if (pipeline->backend != COGL_PIPELINE_BACKEND_UNDEFINED &&
- _cogl_pipeline_backends[pipeline->backend]->pipeline_set_parent_notify)
+ if (pipeline->fragend != COGL_PIPELINE_FRAGEND_UNDEFINED &&
+ _cogl_pipeline_fragends[pipeline->fragend]->pipeline_set_parent_notify)
{
- const CoglPipelineBackend *backend =
- _cogl_pipeline_backends[pipeline->backend];
- backend->pipeline_set_parent_notify (pipeline);
+ const CoglPipelineFragend *fragend =
+ _cogl_pipeline_fragends[pipeline->fragend];
+ fragend->pipeline_set_parent_notify (pipeline);
}
}
pipeline->layers_cache_dirty = TRUE;
pipeline->deprecated_get_layers_list_dirty = TRUE;
- pipeline->backend = src->backend;
- pipeline->backend_priv_set_mask = 0;
+ pipeline->fragend = src->fragend;
+ pipeline->fragend_priv_set_mask = 0;
pipeline->has_static_breadcrumb = FALSE;
}
static void
-_cogl_pipeline_backend_free_priv (CoglPipeline *pipeline)
+_cogl_pipeline_fragend_free_priv (CoglPipeline *pipeline)
{
- if (pipeline->backend != COGL_PIPELINE_BACKEND_UNDEFINED &&
- _cogl_pipeline_backends[pipeline->backend]->free_priv)
+ if (pipeline->fragend != COGL_PIPELINE_FRAGEND_UNDEFINED &&
+ _cogl_pipeline_fragends[pipeline->fragend]->free_priv)
{
- const CoglPipelineBackend *backend =
- _cogl_pipeline_backends[pipeline->backend];
- backend->free_priv (pipeline);
+ const CoglPipelineFragend *fragend =
+ _cogl_pipeline_fragends[pipeline->fragend];
+ fragend->free_priv (pipeline);
}
}
g_assert (!COGL_PIPELINE_NODE (pipeline)->has_children);
- _cogl_pipeline_backend_free_priv (pipeline);
+ _cogl_pipeline_fragend_free_priv (pipeline);
_cogl_pipeline_unparent (COGL_PIPELINE_NODE (pipeline));
}
void
-_cogl_pipeline_set_backend (CoglPipeline *pipeline, int backend)
+_cogl_pipeline_set_fragend (CoglPipeline *pipeline, int fragend)
{
- _cogl_pipeline_backend_free_priv (pipeline);
- pipeline->backend = backend;
+ _cogl_pipeline_fragend_free_priv (pipeline);
+ pipeline->fragend = fragend;
}
static void
* 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_BACKEND_FIXED
- if (pipeline->backend == COGL_PIPELINE_BACKEND_FIXED)
- _cogl_pipeline_set_backend (pipeline, COGL_PIPELINE_BACKEND_UNDEFINED);
+#ifdef COGL_PIPELINE_FRAGEND_FIXED
+ if (pipeline->fragend == COGL_PIPELINE_FRAGEND_FIXED)
+ _cogl_pipeline_set_fragend (pipeline, COGL_PIPELINE_FRAGEND_UNDEFINED);
#endif
- if (pipeline->backend != COGL_PIPELINE_BACKEND_UNDEFINED &&
- _cogl_pipeline_backends[pipeline->backend]->pipeline_pre_change_notify)
+ if (pipeline->fragend != COGL_PIPELINE_FRAGEND_UNDEFINED &&
+ _cogl_pipeline_fragends[pipeline->fragend]->pipeline_pre_change_notify)
{
- const CoglPipelineBackend *backend =
- _cogl_pipeline_backends[pipeline->backend];
+ const CoglPipelineFragend *fragend =
+ _cogl_pipeline_fragends[pipeline->fragend];
/* To simplify things for the backends we are careful about how
* we report STATE_LAYERS changes.
* layer pre-change notification for any particular change.
*/
if (!from_layer_change)
- backend->pipeline_pre_change_notify (pipeline, change, new_color);
+ fragend->pipeline_pre_change_notify (pipeline, change, new_color);
}
/* There may be an arbitrary tree of descendants of this pipeline;
}
static void
-_cogl_pipeline_backend_layer_change_notify (CoglPipeline *owner,
+_cogl_pipeline_fragend_layer_change_notify (CoglPipeline *owner,
CoglPipelineLayer *layer,
CoglPipelineLayerState change)
{
* have a single owner and can only be associated with a single
* backend that needs to be notified of the layer change...
*/
- if (owner->backend != COGL_PIPELINE_BACKEND_UNDEFINED &&
- _cogl_pipeline_backends[owner->backend]->layer_pre_change_notify)
+ if (owner->fragend != COGL_PIPELINE_FRAGEND_UNDEFINED &&
+ _cogl_pipeline_fragends[owner->fragend]->layer_pre_change_notify)
{
- const CoglPipelineBackend *backend =
- _cogl_pipeline_backends[owner->backend];
- backend->layer_pre_change_notify (owner, layer, change);
+ const CoglPipelineFragend *fragend =
+ _cogl_pipeline_fragends[owner->fragend];
+ fragend->layer_pre_change_notify (owner, layer, change);
}
}
* this layer (required_owner), and there are no other layers
* dependant on this layer so it's ok to modify it. */
- _cogl_pipeline_backend_layer_change_notify (required_owner, layer, change);
+ _cogl_pipeline_fragend_layer_change_notify (required_owner, layer, change);
/* If the layer being changed is the same as the last layer we
* flushed to the corresponding texture unit then we keep a track of
_cogl_pipeline_pre_change_notify (pipeline, state, NULL, FALSE);
if (program != COGL_INVALID_HANDLE)
- _cogl_pipeline_set_backend (pipeline, COGL_PIPELINE_BACKEND_DEFAULT);
+ _cogl_pipeline_set_fragend (pipeline, COGL_PIPELINE_FRAGEND_DEFAULT);
/* If we are the current authority see if we can revert to one of our
* ancestors being the authority */