diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c index aca9c20cd..4a4091634 100644 --- a/cogl/cogl-primitives.c +++ b/cogl/cogl-primitives.c @@ -308,12 +308,6 @@ validate_tex_coords_cb (CoglPipeline *pipeline, state->i++; - texture = cogl_pipeline_get_layer_texture (pipeline, layer_index); - - /* NB: NULL textures are handled by _cogl_pipeline_flush_gl_state */ - if (!texture) - return TRUE; - /* FIXME: we should be able to avoid this copying when no * transform is required by the texture backend and the user * has supplied enough coordinates for all the layers. @@ -330,6 +324,12 @@ validate_tex_coords_cb (CoglPipeline *pipeline, memcpy (out_tex_coords, in_tex_coords, sizeof (float) * 4); + texture = cogl_pipeline_get_layer_texture (pipeline, layer_index); + + /* NB: NULL textures are handled by _cogl_pipeline_flush_gl_state */ + if (!texture) + return TRUE; + /* Convert the texture coordinates to GL. */ transform_result =