diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-10-19 12:47:22 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2011-11-02 13:50:28 +0000 |
commit | 00f0a66ec949a641db744f56230c2bcfc98c1883 (patch) | |
tree | 2546ac68ddda46ba137ae2465fbda92a8ae9f718 /cogl/cogl-pipeline-private.h | |
parent | 884647071cc375ec10f306400c3d72bcb81550a3 (diff) | |
download | cogl-00f0a66ec949a641db744f56230c2bcfc98c1883.tar.gz |
Use the same number for n_tex_coord_attribs in all linked shaders
On GLES2, we need to specify an array size for the texture coord
varying array. Previously this size would be decided in one of the
following ways:
- For generated vertex shaders it is always the number of layers in
the pipeline.
- For generated fragment shaders it is the highest sampled texture
unit in the pipeline or the number of attributes supplied by the
primitive, whichever is higher.
- For user shaders it is usually the number of attributes supplied by
the primitive. However, if the application tries to compile the
shader and query the result before using it, it will always be at
least 4.
These shaders can quite easily end up with different values for the
declaration which makes it fail to link. This patch changes it so that
all of the shaders are generated with the maximum of the number of
texture attributes supplied by the primitive and the number of layers
in the pipeline. If this value changes then the shaders are
regenerated, including user shaders. That way all of the shaders will
always have the same value.
https://bugzilla.gnome.org/show_bug.cgi?id=662184
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-pipeline-private.h')
-rw-r--r-- | cogl/cogl-pipeline-private.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h index b8965c29..57f3503e 100644 --- a/cogl/cogl-pipeline-private.h +++ b/cogl/cogl-pipeline-private.h @@ -542,7 +542,8 @@ typedef struct _CoglPipelineVertend { gboolean (*start) (CoglPipeline *pipeline, int n_layers, - unsigned long pipelines_difference); + unsigned long pipelines_difference, + int n_tex_coord_attribs); gboolean (*add_layer) (CoglPipeline *pipeline, CoglPipelineLayer *layer, unsigned long layers_difference); |