Re: How can we gracefully handle Cogl and GL out of memory conditions?
- From: Robert Bragg <robert sixbynine org>
- To: Reza Ghassemi <reza robin1 gmail com>
- Cc: clutter-list gnome org
- Subject: Re: How can we gracefully handle Cogl and GL out of memory conditions?
- Date: Sat, 12 Oct 2013 14:43:43 +0100
Hi Reza,
Cogl 1.14 should be able to gracefully report out of memory conditions when allocating textures and framebuffers. The recommended way would be to use cogl_texture_allocate() and cogl_framebuffer_allocate() to explicitly try and allocate texture and framebuffer resources which can report a CoglError if there was a problem.
If you are using Cogl's high level texture constructors like cogl_texture_new_with_size or cogl_texture_new_from_data then these apis should return NULL if there was a problem allocating the texture due to lack of memory but in Cogl 1.14 it looks like we broke these semantics and it's possible for cogl_texture_new_with_size to return a CoglTexture object which doesn't yet have an associated allocation and you could hit an error later if you try to create a framebuffer from that texture if it turns out you don't have enough memory.
I think Clutter 1.14 uses cogl_texture_new_with_size for the offscreen effects and it is expecting it to return NULL if there is an error. Similarly Clutter uses cogl_offscreen_new_to_texture() and expects that to return NULL on failure to allocate. I'm afraid that we also broke the semantics of this api too :-/
I've just push a wip/cogl-14-fixes branch with a couple of patches that may help you by fixing both of those regressions on the 1.14 branch.
I hope that helps,
Robert
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]