diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-09-19 15:22:04 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-09-19 16:40:07 +0100 |
commit | 1984fea4b13239172c09da61d24d82030c84ee56 (patch) | |
tree | bee3fc840795eb8d8a6060a1c29278a62d85528e | |
parent | dbff3a357eb556aac577a2aecfbb5b037a9defca (diff) | |
download | cogl-1984fea4b13239172c09da61d24d82030c84ee56.tar.gz |
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>
-rw-r--r-- | 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 ce24543e..9fd412ee 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; } |