The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Difference in behaviour between GLX and EGL contect creation
Emmanuel Gil Peyrot
Guest

Hi,

I noticed a quite trappy difference in the frame buffer configuration
selection done by the GLX and EGL code. Both emit their wish, as the
user defined it using SDL_GL_SetAttribute, but GLX selects the first
one, which is the best, and EGL the most fitting.

I noticed that issue because the default is RGB332, which always gave
me a RGB888 frame buffer on X11, but gave me a RGB565 one on Wayland.

I don’t know what the solution is, maybe removing the code trying to
find the most fitting configuration from EGL would make the most sense.

I also haven’t checked what the other backends do, for that context
creation issue.

--
Emmanuel Gil Peyrot

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Difference in behaviour between GLX and EGL contect creation
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
2015-03-26 14:10 GMT-03:00 Emmanuel Gil Peyrot:
Quote:
Hi,

I noticed a quite trappy difference in the frame buffer configuration
selection done by the GLX and EGL code.  Both emit their wish, as the
user defined it using SDL_GL_SetAttribute, but GLX selects the first
one, which is the best, and EGL the most fitting.

I noticed that issue because the default is RGB332, which always gave
me a RGB888 frame buffer on X11, but gave me a RGB565 one on Wayland.

I don’t know what the solution is, maybe removing the code trying to
find the most fitting configuration from EGL would make the most sense.



Why? Trying to find the lowest config that fits the provided parameters is the best solution IMO, specially on mobile where every bit counts.


If you really care about getting the same config across backends, you can always ask for RGB888.
Difference in behaviour between GLX and EGL contect creation
Emmanuel Gil Peyrot
Guest

On Thu, Mar 26, 2015 at 03:17:48PM -0300, Gabriel Jacobo wrote:
Quote:
2015-03-26 14:10 GMT-03:00 Emmanuel Gil Peyrot:

Quote:
Hi,

I noticed a quite trappy difference in the frame buffer configuration
selection done by the GLX and EGL code. Both emit their wish, as the
user defined it using SDL_GL_SetAttribute, but GLX selects the first
one, which is the best, and EGL the most fitting.

I noticed that issue because the default is RGB332, which always gave
me a RGB888 frame buffer on X11, but gave me a RGB565 one on Wayland.

I don’t know what the solution is, maybe removing the code trying to
find the most fitting configuration from EGL would make the most sense.


Why? Trying to find the lowest config that fits the provided parameters is
the best solution IMO, specially on mobile where every bit counts.

Hmm, I hadn’t thought about mobile, and indeed it makes sense.

It’s quite funny since I think I encountered a bug on GLES, where Mesa
would unconditionally give me a RGB888 frame buffer instead of the
selected one.

Quote:

If you really care about getting the same config across backends, you can
always ask for RGB888.

That’s what I did in my game engine to fix that, no problem.

But this is still an issue of consistency between backends. I would
suggest backporting the best-fitting code from EGL to GLX, to prevent
getting a RGB332 frame buffer on some backends and not understanding
why.

--
Emmanuel Gil Peyrot

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org