diff --git a/cogl/cogl/cogl-private.h b/cogl/cogl/cogl-private.h index 2878a1640..5a714fc1a 100644 --- a/cogl/cogl/cogl-private.h +++ b/cogl/cogl/cogl-private.h @@ -67,6 +67,9 @@ typedef enum */ COGL_PRIVATE_FEATURE_ANY_GL, + /* This is a Mali bug/quirk: */ + COGL_PRIVATE_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH, + COGL_N_PRIVATE_FEATURES } CoglPrivateFeature; diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c index 07ab82074..88978abb3 100644 --- a/cogl/cogl/cogl-texture-2d.c +++ b/cogl/cogl/cogl-texture-2d.c @@ -403,6 +403,10 @@ _cogl_texture_2d_pre_paint (CoglTexture *tex, CoglTexturePrePaintFlags flags) */ _cogl_texture_flush_journal_rendering (tex); + if (_cogl_has_private_feature (ctx, COGL_PRIVATE_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH) && + _cogl_texture_get_associated_framebuffers (tex)) + ctx->glFlush (); + ctx->driver_vtable->texture_2d_generate_mipmap (tex_2d); tex_2d->mipmaps_dirty = FALSE; diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 00f72fbab..de080a99d 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -440,6 +440,13 @@ _cogl_driver_update_features (CoglContext *context, if (context->glGenQueries && context->glQueryCounter && context->glGetInteger64v) COGL_FLAGS_SET (context->features, COGL_FEATURE_ID_TIMESTAMP_QUERY, TRUE); + if (!g_strcmp0 ((char *) context->glGetString (GL_RENDERER), "Mali-400 MP")) + { + COGL_FLAGS_SET (private_features, + COGL_PRIVATE_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH, + TRUE); + } + /* Cache features */ for (i = 0; i < G_N_ELEMENTS (private_features); i++) context->private_features[i] |= private_features[i];