simple-egl: only force config buffer size for 16bpp

Constraining the buffer size of an EGLConfig to 32 means that
the sum of red, green, blue, and alpha channels must equal 32.
This constraint prevented weston-simple-egl from picking an
RGBX pixel format when an opaque surface was asked for, since
the typical RGBX pixel formats have buffer sizes of 30, 24,
and 16.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
This commit is contained in:
Manuel Stoeckl 2021-10-31 21:36:58 -04:00 committed by Marius Vlad
parent 4564b799b8
commit b4e70a49ef

View File

@ -181,7 +181,7 @@ init_egl(struct display *display, struct window *window)
for (i = 0; i < n; i++) {
eglGetConfigAttrib(display->egl.dpy,
configs[i], EGL_BUFFER_SIZE, &size);
if (window->buffer_size == size) {
if (window->buffer_size == 0 || window->buffer_size == size) {
display->egl.conf = configs[i];
break;
}
@ -818,7 +818,7 @@ main(int argc, char **argv)
window.geometry.width = 250;
window.geometry.height = 250;
window.window_size = window.geometry;
window.buffer_size = 32;
window.buffer_size = 0;
window.frame_sync = 1;
window.delay = 0;