cogl: Ensure GL_TEXTURE_MAX_LEVEL is set before using it

Just in case it was lower before. So that `upload_subregion_to_gl` is
not trying to upload to a disallowed mipmap level.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
This commit is contained in:
Daniel van Vugt 2020-02-11 17:11:36 +08:00 committed by Jonas Ådahl
parent 73ce9c2e81
commit a3f27dfd89

View File

@ -567,6 +567,8 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
&gl_format, &gl_format,
&gl_type); &gl_type);
_cogl_texture_gl_maybe_update_max_level (tex, level);
status = ctx->texture_driver->upload_subregion_to_gl (ctx, status = ctx->texture_driver->upload_subregion_to_gl (ctx,
tex, tex,
src_x, src_y, src_x, src_y,
@ -580,8 +582,6 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
cogl_object_unref (upload_bmp); cogl_object_unref (upload_bmp);
_cogl_texture_gl_maybe_update_max_level (tex, level);
return status; return status;
} }