On Thu, Jul 16, 2009 at 08:20:03AM -0600, Brian Paul wrote: > Chia-I Wu wrote: > >A context or surface that is neither linked to a display nor current to > >a thread should be destroyed. Therefore, an unlinked context or surface > >implies a pending delete automatically. > IIRC, the EGL spec has some language about deleting > surfaces/contexts that are currently bound. Do your changes respect > that language? I haven't gone back to re-read the spec so I may be > off base. Yes.
The behavior regards destroying a context/surface that is current to some thread is described more explicitly in eglspec.1.4.20090623.pdf. It refers to eglTerminate, which says If contexts or surfaces created with respect to dpy are current (see section 3.7.3) to any thread, then they are not actually destroyed while they remain current. Such contexts and surfaces will be destroyed as soon as eglReleaseThread is called from the thread they are bound to, or eglMakeCurrent is called from that thread with the current rendering API (see section 3.7) set such that the current context is affected. However, handles referring to such surfaces and contexts become invalid as soon as eglTerminate returns. Passing such handles to any other EGL function will generate EGL_BAD_SURFACE or EGL_BAD_CONTEXT errors. Destroying a context or surface will unlink it from its display, while looking up an unlinked context or surface will return NULL. This makes a destroyed resource always invalid, even if it is not really free()ed. That happens only when the resource is "current" to some thread. Later when it is no longer current, or when the thread is released, it is free()ed. But I haven't check every spot that if an invalid resource is always checked or EGL_BAD_SURFACE/ EGL_BAD_CONTEXT is correctly set. This is one of the items that I plan to work on. > >+#define _EGL_DISPLAY_IS_LINKED(dpy) ((dpy)->Handle) > >+#define _EGL_CONTEXT_IS_LINKED(ctx) ((ctx)->Display) > >+#define _EGL_SURFACE_IS_LINKED(surf) ((surf)->Display) > These should be inline functions. Will do. -- Regards, olv ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev