<div dir="ltr">Lukasz,<div><br></div><div>Thanks for the answer, it makes sense.</div><div><br></div><div>I was able to replace GLX with EGL for X11, but it does not work on Wayland rendering directly to the window (I've confirmed with GTK devs).</div><div><br></div><div>So the way to go is to use DMABUF to render offscreen and share the buffer with GTK - by my research it's done efficiently and does not copy the buffer to CPU.</div><div><br></div><div>It's the way it's done on Webkit and Firefox.</div><div><br></div><div>Matthias Clasen recently merged a DMABUF support on GTK4. But it probably works with more effort on Gtk3 and early Gtk4 as well.</div><div><br></div><div>Cheers</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 24 de out. de 2023 às 04:13, Lukasz Kostyra <<a href="mailto:lukasz.kostyra@oracle.com">lukasz.kostyra@oracle.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-4652527727811861525">





<div lang="en-NL" style="overflow-wrap: break-word;">
<div class="m_-4652527727811861525WordSection1">
<p class="MsoNormal"><span lang="PL">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="PL"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I don’t have much ES2 experience, so I cannot really answer 1). But I think I can somewhat answer 2) based on Windows OpenGL knowledge.<br>
<br>
This might be a situation similar to how Windows handles GL contexts. When you create a context in modern GL (3.0 and onwards, aka. Core) you must acquire some newer GL/WGL calls which can create such context. These calls are GL extensions, so to get them you
 need to be able to call `wglGetProcAddress()`. To be able to call `wglGetProcAddress()` on Windows you need to first make any GL context current. Core WGL exposes calls to create a 1.1 Context, but they require a window.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">As such, usual path to get a 3.0 Context on Windows is as follows:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">- Create a dummy/invisible window<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">- Use a dummy window to create 1.1 Context (aka false context)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">- Make 1.1 false context current<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">- Fetch necessary functions via `wglGetProcAddress()`<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">- Create a proper 3.0 Context and make It current<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">For reference, Khronos Wiki mentions this briefly:
<a href="https://www.khronos.org/opengl/wiki/Creating_an_OpenGL_Context_(WGL)#Create_a_False_Context" target="_blank">
https://www.khronos.org/opengl/wiki/Creating_an_OpenGL_Context_(WGL)#Create_a_False_Context</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I think on Linux and with GLX such behavior is not required (AFAIK glXGetProcAddress could fetch GL/GLX extensions without a current context), but to keep it consistent on all platforms
 ES2 seems to follow this path regardless.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">BRs,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Lukasz<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> openjfx-dev <<a href="mailto:openjfx-dev-retn@openjdk.org" target="_blank">openjfx-dev-retn@openjdk.org</a>>
<b>On Behalf Of </b>Thiago Milczarek Sayão<br>
<b>Sent:</b> Friday, 20 October 2023 22:38<br>
<b>To:</b> openjfx-dev <<a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>><br>
<b>Subject:</b> Exploring the prism es2 land - couple of questions<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have some questions on prism es2.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">1) Why is a Context created on each platform GLFactory if there is a GLContext?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">2) What is the use of the Dummy Window?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm working on using EGL instead of GLX, so it will work on Wayland.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks.<u></u><u></u></p>
</div>
</div>
</div>
</div>

</div></blockquote></div>