Skip to content

Commit f55177c

Browse files
authored
Merge pull request #507 from fredldotme/android-no-pixmap-bit
src/glx: Don't use EGL_PIXMAP_BIT on Android
2 parents c455dc8 + 696b2f2 commit f55177c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/glx/glx.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,10 @@ GLXFBConfig *gl4es_glXChooseFBConfig(Display *display, int screen,
18411841
attr[cur++] = EGL_STENCIL_SIZE;
18421842
attr[cur++] = 8;
18431843
}
1844-
attr[1] |= (globals4es.usepbuffer)?(/*EGL_PBUFFER_BIT|*/EGL_PIXMAP_BIT):EGL_WINDOW_BIT;
1844+
1845+
// Android (E)GL drivers usually don't support the EGL_PIXMAP_BIT here,
1846+
// so only use EGL_PBUFFER_BIT
1847+
attr[1] |= (globals4es.usepbuffer)?(hardext.android?(EGL_PBUFFER_BIT):(/*EGL_PBUFFER_BIT|*/EGL_PIXMAP_BIT)):(EGL_WINDOW_BIT);
18451848

18461849
attr[cur++] = EGL_RENDERABLE_TYPE;
18471850
attr[cur++] = (hardext.esversion==1)?EGL_OPENGL_ES_BIT:EGL_OPENGL_ES2_BIT;
@@ -1944,7 +1947,7 @@ GLXFBConfig *gl4es_glXGetFBConfigs(Display *display, int screen, int *count) {
19441947
int cur = 0;
19451948
int tmp;
19461949
attr[cur++] = EGL_SURFACE_TYPE;
1947-
attr[cur++] = (globals4es.usepbuffer)?(EGL_PBUFFER_BIT|EGL_PIXMAP_BIT):EGL_WINDOW_BIT;
1950+
attr[cur++] = (globals4es.usepbuffer)?(hardext.android?EGL_PBUFFER_BIT:(EGL_PBUFFER_BIT|EGL_PIXMAP_BIT)):EGL_WINDOW_BIT;
19481951
attr[cur++] = EGL_RENDERABLE_TYPE;
19491952
attr[cur++] = (hardext.esversion==1)?EGL_OPENGL_ES_BIT:EGL_OPENGL_ES2_BIT;
19501953
attr[cur++] = EGL_NONE; // end list

0 commit comments

Comments
 (0)