@@ -924,24 +924,36 @@ egl::Error DisplayGbm::makeCurrent(egl::Surface *drawSurface,
924924
925925egl::ConfigSet DisplayGbm::generateConfigs ()
926926{
927- egl::ConfigSet configs;
928-
929- egl::Config config;
930- config.bufferSize = 32 ;
931- config.redSize = 8 ;
932- config.greenSize = 8 ;
933- config.blueSize = 8 ;
934- config.alphaSize = 8 ;
935- config.depthSize = 24 ;
936- config.stencilSize = 8 ;
937- config.bindToTextureRGBA = EGL_TRUE;
938- config.renderableType = EGL_OPENGL_ES2_BIT;
939- config.surfaceType = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
940- config.renderTargetFormat = GL_RGBA8;
941- config.depthStencilFormat = GL_DEPTH24_STENCIL8;
942-
943- configs.add (config);
944- return configs;
927+
928+ gl::Version eglVersion (mEGL ->majorVersion , mEGL ->minorVersion );
929+ ASSERT (eglVersion >= gl::Version (1 , 4 ));
930+
931+ bool supportES3 =
932+ (eglVersion >= gl::Version (1 , 5 ) || mEGL ->hasExtension (" EGL_KHR_create_context" )) &&
933+ (mRenderer ->getMaxSupportedESVersion () >= gl::Version (3 , 0 ));
934+ EGLint renderType = EGL_OPENGL_ES2_BIT | (supportES3 ? EGL_OPENGL_ES3_BIT : 0 );
935+
936+ // clang-format off
937+ std::vector<EGLint> configAttribs8888 =
938+ {
939+ EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
940+ // CrOS doesn't support window and pixmaps?
941+ EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
942+ EGL_CONFIG_CAVEAT, EGL_NONE,
943+ EGL_CONFORMANT, renderType,
944+ EGL_RENDERABLE_TYPE, renderType,
945+ EGL_RED_SIZE, 8 ,
946+ EGL_GREEN_SIZE, 8 ,
947+ EGL_BLUE_SIZE, 8 ,
948+ EGL_ALPHA_SIZE, 8 ,
949+ EGL_BUFFER_SIZE, 32 ,
950+ EGL_DEPTH_SIZE, 24 ,
951+ EGL_NONE
952+ };
953+ // clang-format on
954+
955+ mConfigAttribList = configAttribs8888;
956+ return DisplayEGL::generateConfigs ();
945957}
946958
947959bool DisplayGbm::isValidNativeWindow (EGLNativeWindowType window) const
0 commit comments