diff options
author | Robert Bragg <robert@linux.intel.com> | 2012-09-25 21:08:10 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-01-22 17:48:00 +0000 |
commit | 8f3380adc30dceb23122a31a6526c517e0a85794 (patch) | |
tree | e1538699519186607e60f8651b62d54db24c7720 /cogl/cogl-pipeline-private.h | |
parent | f05a1a62f408f458a530aade107b66c6cb06ddd0 (diff) | |
download | cogl-8f3380adc30dceb23122a31a6526c517e0a85794.tar.gz |
Clearly define 3 progends that own the frag+vertends
This adds a new "fixed-arbfp" progend so we now have 3 distinct ways of
setting up the state of a pipeline:
» fixed; where the vertex and fragment processing are implemented
using fixed function opengl apis.
» fixed-arbfp; where vertex processing is implemented using fixed
function opengl apis but fragment processing is implemented
using the ARB Fragment Processing language.
» glsl; there vertex and fragment processing are both implemented
using glsl.
This means we avoid unusual, combinations such as glsl for vertex
processing and arbfp for fragment processing, and also avoid pairing
fixed-function vertex processing with glsl fragment processing which we
happen to know hits some awkward code paths in Mesa that lead to poor
performance.
As part of this change, the progend now implies specific vertend and
fragend choices so instead of associating a vertend and fragend with a
pipeline we now just associate a progend choice.
When flushing a pipeline and choosing what progend to use, we now call a
progend->start() method that is able to determine if the vertend and
fragend together will be able to handle the given pipeline so the
vertend and fragend ->start() methods no longer need to return a boolean
status.
Since we now don't need to support glsl used in conjunction with fixed
function this will allow us to avoid ever using OpenGL builtin attribute
names, though this patch doesn't change that yet.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit cec381f50c7a2f2186bd4a8c5f38fecd5f099075)
Diffstat (limited to 'cogl/cogl-pipeline-private.h')
-rw-r--r-- | cogl/cogl-pipeline-private.h | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h index 31a84c0a..64c853bc 100644 --- a/cogl/cogl-pipeline-private.h +++ b/cogl/cogl-pipeline-private.h @@ -45,9 +45,10 @@ #ifdef HAVE_COGL_GL -#define COGL_PIPELINE_PROGEND_FIXED 0 -#define COGL_PIPELINE_PROGEND_GLSL 1 -#define COGL_PIPELINE_N_PROGENDS 2 +#define COGL_PIPELINE_PROGEND_FIXED_ARBFP 0 +#define COGL_PIPELINE_PROGEND_FIXED 1 +#define COGL_PIPELINE_PROGEND_GLSL 2 +#define COGL_PIPELINE_N_PROGENDS 3 #define COGL_PIPELINE_VERTEND_FIXED 0 #define COGL_PIPELINE_VERTEND_GLSL 1 @@ -97,11 +98,8 @@ #endif /* HAVE_COGL_GL */ -#define COGL_PIPELINE_FRAGEND_DEFAULT 0 -#define COGL_PIPELINE_FRAGEND_UNDEFINED 3 - -#define COGL_PIPELINE_VERTEND_DEFAULT 0 -#define COGL_PIPELINE_VERTEND_UNDEFINED 3 +#define COGL_PIPELINE_PROGEND_DEFAULT 0 +#define COGL_PIPELINE_PROGEND_UNDEFINED 3 /* XXX: should I rename these as * COGL_PIPELINE_STATE_INDEX_XYZ... ? @@ -480,20 +478,19 @@ struct _CoglPipeline * where the pipeline originates from */ unsigned int has_static_breadcrumb:1; - /* There are multiple fragment processing backends for CoglPipeline, - * 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 fragend:3; - unsigned int vertend:3; + /* There are multiple fragment and vertex processing backends for + * CoglPipeline, glsl, arbfp and fixed that are bundled under a + * "progend". This identifies the backend being used for the + * pipeline. */ + unsigned int progend:3; }; typedef struct _CoglPipelineFragend { - CoglBool (*start) (CoglPipeline *pipeline, - int n_layers, - unsigned long pipelines_difference, - int n_tex_coord_attribs); + void (*start) (CoglPipeline *pipeline, + int n_layers, + unsigned long pipelines_difference, + int n_tex_coord_attribs); CoglBool (*add_layer) (CoglPipeline *pipeline, CoglPipelineLayer *layer, unsigned long layers_difference); @@ -512,10 +509,10 @@ typedef struct _CoglPipelineFragend typedef struct _CoglPipelineVertend { - CoglBool (*start) (CoglPipeline *pipeline, - int n_layers, - unsigned long pipelines_difference, - int n_tex_coord_attribs); + void (*start) (CoglPipeline *pipeline, + int n_layers, + unsigned long pipelines_difference, + int n_tex_coord_attribs); CoglBool (*add_layer) (CoglPipeline *pipeline, CoglPipelineLayer *layer, unsigned long layers_difference, @@ -533,6 +530,9 @@ typedef struct _CoglPipelineVertend typedef struct { + int vertend; + int fragend; + CoglBool (*start) (CoglPipeline *pipeline); void (*end) (CoglPipeline *pipeline, unsigned long pipelines_difference, int n_tex_coord_attribs); @@ -818,10 +818,7 @@ _cogl_pipeline_weak_copy (CoglPipeline *pipeline, void *user_data); void -_cogl_pipeline_set_fragend (CoglPipeline *pipeline, int fragend); - -void -_cogl_pipeline_set_vertend (CoglPipeline *pipeline, int vertend); +_cogl_pipeline_set_progend (CoglPipeline *pipeline, int progend); CoglPipeline * _cogl_pipeline_get_parent (CoglPipeline *pipeline); |