From: Sunghyun kim Date: Thu, 25 Apr 2019 09:54:31 +0000 (+0900) Subject: Fallback to GLES 2.0 when num_config is 0 X-Git-Tag: dali_1.4.20~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b85ff4310a6b47a925d7ae6997a21aad32df7637;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Fallback to GLES 2.0 when num_config is 0 when eglChooseConfig() is successed but num_config is 0, creating context is failed. it is depends on GPU driver, but we need to protect. Change-Id: I68484312f2719a5e0c108e8d7a70fbf3d10d70f9 --- diff --git a/dali/internal/graphics/gles/egl-implementation.cpp b/dali/internal/graphics/gles/egl-implementation.cpp index 91d4fab..2172e37 100755 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -401,7 +401,10 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) #endif // DALI_PROFILE_UBUNTU configAttribs.PushBack( EGL_NONE ); - if ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE ) + // Ensure number of configs is set to 1 as on some drivers, + // eglChooseConfig succeeds but does not actually create a proper configuration. + if ( ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE ) || + ( numConfigs != 1 ) ) { if( mGlesVersion >= 30 ) { @@ -410,6 +413,13 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) return false; } + if ( numConfigs != 1 ) + { + DALI_LOG_ERROR("No configurations found.\n"); + + TEST_EGL_ERROR("eglChooseConfig"); + } + EGLint error = eglGetError(); switch (error) { @@ -460,13 +470,6 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) } mContextAttribs.PushBack( EGL_NONE ); - if ( numConfigs != 1 ) - { - DALI_LOG_ERROR("No configurations found.\n"); - - TEST_EGL_ERROR("eglChooseConfig"); - } - return true; }