[cogl] cogl-primitives: Don't warn if using sliced textures without multi-tex



commit 1984fea4b13239172c09da61d24d82030c84ee56
Author: Neil Roberts <neil linux intel com>
Date:   Mon Sep 19 15:22:04 2011 +0100

    cogl-primitives: Don't warn if using sliced textures without multi-tex
    
    cogl_rectangle has some validation code to check whether the first
    layer has a sliced texture. If so it will abandon the rest of the
    layers and print a warning. However it was even doing this pruning and
    displaying the warning if there is only one layer. This patch just
    makes it check whether the pipeline actually has more than one layer
    before pruning or displaying the warning but it will still fallback to
    the multiple quads path.
    
    Reviewed-by: Robert Bragg <robert linux intel com>

 cogl/cogl-primitives.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index ce24543..9fd412e 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -636,20 +636,24 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
     {
       if (state->i == 0)
         {
-          static gboolean warning_seen = FALSE;
+          if (cogl_pipeline_get_n_layers (pipeline) > 1)
+            {
+              static gboolean warning_seen = FALSE;
 
-          if (!state->override_source)
-            state->override_source = cogl_pipeline_copy (pipeline);
-          _cogl_pipeline_prune_to_n_layers (state->override_source, 1);
-          state->all_use_sliced_quad_fallback = TRUE;
+              if (!state->override_source)
+                state->override_source = cogl_pipeline_copy (pipeline);
+              _cogl_pipeline_prune_to_n_layers (state->override_source, 1);
 
-          if (!warning_seen)
-            g_warning ("Skipping layers 1..n of your pipeline since "
-                       "the first layer is sliced. We don't currently "
-                       "support any multi-texturing with sliced "
-                       "textures but assume layer 0 is the most "
-                       "important to keep");
-          warning_seen = TRUE;
+              if (!warning_seen)
+                g_warning ("Skipping layers 1..n of your pipeline since "
+                           "the first layer is sliced. We don't currently "
+                           "support any multi-texturing with sliced "
+                           "textures but assume layer 0 is the most "
+                           "important to keep");
+              warning_seen = TRUE;
+            }
+
+          state->all_use_sliced_quad_fallback = TRUE;
 
           return FALSE;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]