mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
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>
This commit is contained in:
parent
dbff3a357e
commit
1984fea4b1
@ -635,13 +635,14 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
|
||||
if (cogl_texture_is_sliced (texture))
|
||||
{
|
||||
if (state->i == 0)
|
||||
{
|
||||
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 (!warning_seen)
|
||||
g_warning ("Skipping layers 1..n of your pipeline since "
|
||||
@ -650,6 +651,9 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
|
||||
"textures but assume layer 0 is the most "
|
||||
"important to keep");
|
||||
warning_seen = TRUE;
|
||||
}
|
||||
|
||||
state->all_use_sliced_quad_fallback = TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user