Exploring the prism es2 land - couple of questions
Thiago Milczarek Sayão
thiago.sayao at gmail.com
Tue Oct 24 11:18:24 UTC 2023
Lukasz,
Thanks for the answer, it makes sense.
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).
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.
It's the way it's done on Webkit and Firefox.
Matthias Clasen recently merged a DMABUF support on GTK4. But it
probably works with more effort on Gtk3 and early Gtk4 as well.
Cheers
Em ter., 24 de out. de 2023 às 04:13, Lukasz Kostyra <
lukasz.kostyra at oracle.com> escreveu:
> Hi,
>
>
>
> 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.
>
> 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.
>
>
>
> As such, usual path to get a 3.0 Context on Windows is as follows:
>
> - Create a dummy/invisible window
>
> - Use a dummy window to create 1.1 Context (aka false context)
>
> - Make 1.1 false context current
>
> - Fetch necessary functions via `wglGetProcAddress()`
>
> - Create a proper 3.0 Context and make It current
>
>
>
> For reference, Khronos Wiki mentions this briefly:
> https://www.khronos.org/opengl/wiki/Creating_an_OpenGL_Context_(WGL)#Create_a_False_Context
>
>
>
> 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.
>
>
>
> BRs,
>
> Lukasz
>
>
>
> *From:* openjfx-dev <openjfx-dev-retn at openjdk.org> *On Behalf Of *Thiago
> Milczarek Sayão
> *Sent:* Friday, 20 October 2023 22:38
> *To:* openjfx-dev <openjfx-dev at openjdk.org>
> *Subject:* Exploring the prism es2 land - couple of questions
>
>
>
> Hi,
>
>
>
> I have some questions on prism es2.
>
>
>
> 1) Why is a Context created on each platform GLFactory if there is a
> GLContext?
>
>
>
> 2) What is the use of the Dummy Window?
>
>
>
> I'm working on using EGL instead of GLX, so it will work on Wayland.
>
>
>
> Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231024/bcc67ac6/attachment.htm>
More information about the openjfx-dev
mailing list