Re: How can I avoid COGL:out of memory abort while using offscreen effects?



Hi,

What version of Clutter are you using? I ask because if you are using at
least version 1.14.4 then in theory Clutter should be catching the error
without aborting and it will then silently disable the offscreen effect
(ie, it will paint the actor normally).

The patch that made this change is this:

https://git.gnome.org/browse/clutter/commit/?id=b416224d

It might also depend on what effect you are using. If the effect
overrides the ‘create_texture’ method then it might handle the
allocation differently.

Unfortunately there is an extra complication with this because in
version 1.14 we accidentally broke the Cogl API so that
cogl_texture_new_with_size doesn't return NULL when it can't create the
texture and instead waits until the texture is allocated in order to
report the error. If you are using 1.12 or 1.15 then the function
directly returns NULL on failure.

If you want to detect the error yourself and draw a different effect,
perhaps you could override the create_texture method of the effect and
detect the error in creating the texture. Depending on which version of
Cogl you are using you would have to detect this error in different
ways because of the complication mentioned above.

Regards,
- Neil

Reza Ghassemi <reza robin1 gmail com> writes:

Hello Clutter users,

We have encountered an out of memory issue while
clutter_offscreen_effect_pre_paint is calling cogl_clear().  This occurs
after creating a few 1920x1080 widgets and applying any offscreen effect to
several of them, removing it and reapplying it.

I assume our TV is running out of its limited texture memory, but the
question is is it possible to gracefully handle this (e.g. just draw slower
or switch to a backup effect) in a system that is driven by scripts written
by end developers and without modifying COGL??

For now we're considering not providing offscreen buffer support through
our API.

The stack trace below shows that the cogl_clear() is forcing a
framebuffer_flush_state (not sure why) which ends up allocating texture
memory.  The COGL code is calling cogl_framebuffer allocate with no error
handling I assume because they think it is too late to do anything about it.

Thank you for any insights to this issue.  I'll post this on the COGL forum
as well.

Reza

#1  0x49a632dc in g_logv () from

#2  0x00605ec8 in _cogl_set_error () from

#3  0x0060b024 in _cogl_gl_util_catch_out_of_memory () from

#4  0x0060b728 in _cogl_texture_2d_gl_allocate () from

#5  0x005ee81c in _cogl_texture_2d_allocate () from

#6  0x005edb6c in cogl_texture_allocate () from

#7  0x005f112c in _cogl_texture_2d_sliced_allocate () from

#8  0x005edb6c in cogl_texture_allocate () from

#9  0x005fce0c in cogl_framebuffer_allocate () from

#10 0x006249f0 in _cogl_framebuffer_gl_flush_state () from

#11 0x005fdc08 in _cogl_framebuffer_flush_state () from

#12 0x005fc368 in cogl_framebuffer_clear4f () from

#13 0x005fc534 in cogl_framebuffer_clear () from

#14 0x005b8248 in cogl_clear () from

#15 0x0053417c in clutter_offscreen_effect_pre_paint (effect=0x60e0d058) at
./clutter-offscreen-effect.c:325

#16 0x0051d47c in _clutter_effect_pre_paint (effect=0x60e0d058) at
./clutter-effect.c:304

#17 0x0051d1d0 in clutter_effect_real_paint (effect=0x60e0d058,
flags=CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) at ./clutter-effect.c:243

#18 0x005344a0 in clutter_offscreen_effect_paint (effect=0x60e0d058,
flags=CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) at ./clutter-offscreen-effect.c:434

#19 0x0051d614 in _clutter_effect_paint (effect=0x60e0d058,
flags=CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) at ./clutter-effect.c:321

#20 0x004e6f2c in clutter_actor_continue_paint (self=0x60e3e030) at
./clutter-actor.c:3937

#21 0x004e6be8 in clutter_actor_paint (self=0x60e3e030) at
./clutter-actor.c:3818

#22 0x004e6504 in clutter_actor_real_paint (actor=0x60e3e5e0) at
./clutter-actor.c:35
_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]