egl: Correct conversion of native visual type.
authorChia-I Wu <olvaffe@gmail.com>
Fri, 16 Oct 2009 04:18:25 +0000 (12:18 +0800)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Oct 2009 15:33:27 +0000 (09:33 -0600)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/egl/main/eglconfigutil.c

index a5fcdcd2876ebfceedf76b72f592cbb61e3564ad..36e94f0d2de841203db50eccb0e7951209594793 100644 (file)
@@ -102,7 +102,12 @@ _eglConfigFromContextModesRec(_EGLConfig *conf, const __GLcontextModes *m,
 
    SET_CONFIG_ATTRIB(conf, EGL_NATIVE_RENDERABLE, m->xRenderable);
    SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_ID, m->visualID);
-   SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE, m->visualType);
+
+   if (m->visualType != GLX_NONE)
+      SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE, m->visualType);
+   else
+      SET_CONFIG_ATTRIB(conf, EGL_NATIVE_VISUAL_TYPE, EGL_NONE);
+
    SET_CONFIG_ATTRIB(conf, EGL_RENDERABLE_TYPE, renderable_type);
    SET_CONFIG_ATTRIB(conf, EGL_SAMPLE_BUFFERS, m->sampleBuffers);
    SET_CONFIG_ATTRIB(conf, EGL_SAMPLES, m->samples);