summaryrefslogtreecommitdiff
path: root/cogl/cogl.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-09-27 11:06:16 +0100
committerRobert Bragg <robert@linux.intel.com>2013-01-22 17:48:06 +0000
commit1c449c67f6a02963fdcdbaaec44079a3b6aaa74c (patch)
tree3e904731bee8041dadd0d85b4ab3595dd66c2a2e /cogl/cogl.c
parent14d8ec7ccabc20ae15bc3e60c136eb68a8dd8add (diff)
downloadcogl-1c449c67f6a02963fdcdbaaec44079a3b6aaa74c.tar.gz
Remove the varying array for tex_coords
This removes the need to maintain an array of tex_coord varyings and instead we now just emit a varying per-layer uniquely named using a layer_number infix like cogl_tex_coord0_out and cogl_tex_coord0_in. Notable this patch also had to change the journal flushing code to use pipeline layer numbers to determine the name of texture coordinate attributes. We now also break batches by using a deeper comparison of layers so such that two pipelines with the same number of layers can now cause a batch break if they use different layer numbers. This adds an internal _cogl_pipeline_layer_numbers_equal() function that takes two pipelines and returns TRUE if they have the same number of layers and all the layer numbers are the same too, otherwise it returns FALSE. Where we used to break batches based on changes to the number of layers we now break according to the status of _cogl_pipeline_layer_numbers_equal Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit e55b64a9cdc93285049d9b969bef67484c2d9fb3) Note: this will cause a temporary regression for the Cogl 1.x CoglShader api since it will break compatibility with existing shaders that reference the texture varyings from the fragment shader. The intention is to follow up with another patch to add back CoglShader compatibility.
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r--cogl/cogl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 76ac7175..8cd82a3a 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -431,8 +431,7 @@ cogl_begin_gl (void)
pipeline = cogl_get_source ();
_cogl_pipeline_flush_gl_state (pipeline,
cogl_get_draw_framebuffer (),
- FALSE,
- cogl_pipeline_get_n_layers (pipeline));
+ FALSE);
/* Disable any cached vertex arrays */
_cogl_gl_disable_all_attributes (ctx);