Bug 29824 - OSMesaMakeCurrent triggers assertion on multiple MakeCurrent calls
Summary: OSMesaMakeCurrent triggers assertion on multiple MakeCurrent calls
Status: RESOLVED DUPLICATE of bug 10966
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 13:42 UTC by Vladimir Vukicevic
Modified: 2010-08-26 14:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Vukicevic 2010-08-26 13:42:55 UTC
OSMesaMakeCurrent seems to expect that it will be called only once, because each time it ends up creating a new osmesa renderbuffer from the given buffer and calls _mesa_add_renderbuffer to attach it to BUFFER_FRONT_LEFT.

Ignoring the performance implications of this if you're trying to use OSMesa with multiple contexts, this ends up triggering an assertion in renderbuffer.c _mesa_add_renderbuffer -- it asserts that there's no currently attached renderbuffer at that attachment point, but of course there will be, from the previous time that OSMesaMakeCurrent was called.

I'm not sure if this is currently leading to leaks of the renderbuffer structures if the assertion is ignored; an easy fix would probably be to check if there's a buffer attached to the gl_buffer, and if so, to detach it before attaching a new one.  Not sure how to do that code-wise, though.
Comment 1 Tom Fogal 2010-08-26 14:27:49 UTC
I think that a patch to fix this has been applied to the 7.8 branch, to be released in 7.8.3.

Please reopen if you can reproduce this problem using 7.8 from git.

*** This bug has been marked as a duplicate of bug 10966 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.