opengles emulator: limit X11 configs some more

On Linux/Intel, some configurations are returned which make no sense.
Also, no use for single buffer config, and we don't support pixmap
visuals.

Change-Id: I11f37c8ba612ee10dd654141e6f167add1675dce
This commit is contained in:
Yochai Shefi Simchon
2011-08-01 14:16:44 +03:00
committed by David 'Digit' Turner
parent cd359e5718
commit a22010c0f4

View File

@@ -91,6 +91,7 @@ EglConfig* pixelFormatToConfig(EGLNativeDisplayType dpy,int renderableType,EGLNa
int pMaxWidth,pMaxHeight,pMaxPixels; int pMaxWidth,pMaxHeight,pMaxPixels;
int tmp; int tmp;
int configId,level,renderable; int configId,level,renderable;
int doubleBuffer;
IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_TRANSPARENT_TYPE,&tmp)); IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_TRANSPARENT_TYPE,&tmp));
if(tmp == GLX_TRANSPARENT_INDEX) { if(tmp == GLX_TRANSPARENT_INDEX) {
@@ -106,6 +107,12 @@ EglConfig* pixelFormatToConfig(EGLNativeDisplayType dpy,int renderableType,EGLNa
} }
//
// filter out single buffer configurations
//
IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_DOUBLEBUFFER,&doubleBuffer));
if (!doubleBuffer) return NULL;
IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_BUFFER_SIZE,&bSize)); IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_BUFFER_SIZE,&bSize));
IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_RED_SIZE,&red)); IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_RED_SIZE,&red));
IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_GREEN_SIZE,&green)); IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_GREEN_SIZE,&green));
@@ -123,13 +130,12 @@ EglConfig* pixelFormatToConfig(EGLNativeDisplayType dpy,int renderableType,EGLNa
//supported surfaces types //supported surfaces types
IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_DRAWABLE_TYPE,&tmp)); IS_SUCCESS(glXGetFBConfigAttrib(dpy,*frmt,GLX_DRAWABLE_TYPE,&tmp));
supportedSurfaces = 0; supportedSurfaces = 0;
if(tmp & GLX_WINDOW_BIT) { if(tmp & GLX_WINDOW_BIT && visualId != 0) {
supportedSurfaces |= EGL_WINDOW_BIT; supportedSurfaces |= EGL_WINDOW_BIT;
} else { } else {
visualId = 0; visualId = 0;
visualType = EGL_NONE; visualType = EGL_NONE;
} }
if(tmp & GLX_PIXMAP_BIT) supportedSurfaces |= EGL_PIXMAP_BIT;
if(tmp & GLX_PBUFFER_BIT) supportedSurfaces |= EGL_PBUFFER_BIT; if(tmp & GLX_PBUFFER_BIT) supportedSurfaces |= EGL_PBUFFER_BIT;
caveat = 0; caveat = 0;