<div dir="ltr"><div><div>Hi Tapani,<br><br></div>Sure, I can share them, but they are QNX based. And as far as I remember it was an issue in the past :)<br><br></div>I think the simplest way for you is to add following calls to function eglutCreateWindow():<br><br><a href="https://cgit.freedesktop.org/mesa/demos/tree/src/egl/eglut/eglut.c#n321">https://cgit.freedesktop.org/mesa/demos/tree/src/egl/eglut/eglut.c#n321</a><br><br><pre><code> if (!eglMakeCurrent(_eglut->dpy, win->surface, win->surface, win->context))
_eglutFatal("failed to make window current");</code></pre>to<br><br><pre><code> if (!eglMakeCurrent(_eglut->dpy, win->surface, win->surface, win->context))
_eglutFatal("failed to make window current");<br></code></pre><pre><code> </code><code>eglDestroySurface(</code><code><code>_eglut->dpy, </code></code><code><code>win->surface</code>);</code></pre><div><pre><code> eglDestroyContext</code><code>(</code><code><code><code>_eglut->dpy, </code></code><code><code>win->context</code></code>);</code></pre><div>And then run GLES 1.x gears for example. According to EGL specification, these Destroy calls should be delayed till surface and context is not current in any thread. <span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">Perhaps I understand specification too literally, that's why I'm asking rather than reporting it as a bug.<br><br></span></span></div><div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">Thank you!<br></span></span></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 26, 2017 at 2:09 AM, Tapani Pälli <span dir="ltr"><<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class="">
<div class="m_7530701073859590946moz-cite-prefix">On 04/25/2017 10:20 PM, Mike Gorchak
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi all,<br>
<br>
</div>
During a quick tests of latest Mesa3D versions at
different branches 12.x, 13.x, 17.x we have found that
deferred context and surface destroy doesn't work
properly.<br>
<br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br></span>
What kind of test case are you using, could you share this?<br>
<br>
<blockquote type="cite"><span class="">
<div dir="ltr">
<div>
<div>
<div>According to docs:<br>
<a href="https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglDestroySurface.xhtml" target="_blank">https://www.khronos.org/<wbr>registry/EGL/sdk/docs/man/<wbr>html/eglDestroySurface.xhtml</a><br>
<br>
Description<br>
If the EGL surface is not current to any thread,
eglDestroySurface destroys it immediately. Otherwise,
surface is destroyed when it becomes not current to any
thread. Furthermore, resources associated with a pbuffer
surface are not released until all color buffers of that
pbuffer bound to a texture object have been released. <br>
<br>
</div>
Same for context destroy:<br>
<a href="https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglDestroyContext.xhtml" target="_blank">https://www.khronos.org/<wbr>registry/EGL/sdk/docs/man/<wbr>html/eglDestroyContext.xhtml</a><br>
<br>
Description<br>
If the EGL rendering context is not current to any thread,
eglDestroyContext destroys it immediately. Otherwise,
context is destroyed when it becomes not current to any
thread.<br>
<br>
</div>
Should this behavior be handled at EGL common DRI2 level or
DRI2 platform driver level or it should be handled by EGL
itself? I can see some refcounts implemented for EGL surfaces,
buteglMakeCurrent seems don't increment them for surfaces and
contexts. <br>
<br>
</div>
Thanks!<br>
<br>
</div>
<br>
<fieldset class="m_7530701073859590946mimeAttachmentHeader"></fieldset>
<br>
</span><pre>______________________________<wbr>_________________
mesa-dev mailing list
<a class="m_7530701073859590946moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a>
<a class="m_7530701073859590946moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a>
</pre>
</blockquote>
<p><br>
</p>
</div>
</blockquote></div><br></div>