From 813e2f649d7866ac8ed9233b4b90f3055e143744 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 4 Jul 2019 16:42:36 +0000 Subject: [PATCH] Revert "Check EGL_KHR_Create_Context extension, Prevent glFinish without makeCurrent, Remove ifdef ARM in ChooseConfig" This reverts commit baa3e991beacd0343e825bee0d49d0f8ea6a1700. Reason for revert: Cannot launch any demos on mobile target anymore. Change-Id: I9bbe96afabe7e1cdc715df8147b874d6b317df4d --- dali/internal/graphics/gles/egl-implementation.cpp | 39 ++++++++-------------- dali/internal/graphics/gles/egl-implementation.h | 1 - 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/dali/internal/graphics/gles/egl-implementation.cpp b/dali/internal/graphics/gles/egl-implementation.cpp index 23ed4f4..76fa78a 100755 --- a/dali/internal/graphics/gles/egl-implementation.cpp +++ b/dali/internal/graphics/gles/egl-implementation.cpp @@ -35,9 +35,7 @@ namespace { - const uint32_t CHECK_EXTENSION_NUMBER = 2; const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context"; - const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context"; } namespace Dali @@ -80,8 +78,7 @@ EglImplementation::EglImplementation( int multiSamplingLevel, mIsWindow( true ), mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ), mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ), - mIsSurfacelessContextSupported( false ), - mIsKhrCreateContextSupported( false ) + mIsSurfacelessContextSupported( false ) { } @@ -119,20 +116,14 @@ bool EglImplementation::InitializeGles( EGLNativeDisplayType display, bool isOwn // Query EGL extensions to check whether surfaceless context is supported const char* const extensionStr = eglQueryString( mEglDisplay, EGL_EXTENSIONS ); - std::istringstream stream( extensionStr ); + std::istringstream stream(extensionStr); std::string currentExtension; - uint32_t extensionCheckCount = 0; - while( std::getline( stream, currentExtension, ' ' ) || extensionCheckCount < CHECK_EXTENSION_NUMBER ) + while ( std::getline( stream, currentExtension, ' ' ) ) { - if( currentExtension == EGL_KHR_SURFACELESS_CONTEXT ) + if ( currentExtension == EGL_KHR_SURFACELESS_CONTEXT ) { mIsSurfacelessContextSupported = true; - extensionCheckCount++; - } - if( currentExtension == EGL_KHR_CREATE_CONTEXT ) - { - mIsKhrCreateContextSupported = true; - extensionCheckCount++; + break; } } @@ -220,10 +211,7 @@ void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eg if(mIsOwnSurface) { - if( mCurrentEglContext != EGL_NO_CONTEXT ) - { - glFinish(); - } + glFinish(); eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext ); @@ -252,10 +240,7 @@ void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglS if(mIsOwnSurface) { - if( mCurrentEglContext != EGL_NO_CONTEXT ) - { - glFinish(); - } + glFinish(); eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext ); @@ -365,7 +350,11 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) if( mGlesVersion >= 30 ) { +#ifdef _ARCH_ARM_ configAttribs.PushBack( EGL_OPENGL_ES3_BIT_KHR ); +#else + configAttribs.PushBack( EGL_OPENGL_ES2_BIT ); +#endif // _ARCH_ARM_ } else { @@ -420,7 +409,7 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) if( mGlesVersion >= 30 ) { mEglConfig = NULL; - DALI_LOG_ERROR("Fail to use OpenGL es 3.0. Retrying to use OpenGL es 2.0."); + DALI_LOG_ERROR("Fail to use OpenGL es 3.0. Retring to use OpenGL es 2.0."); return false; } @@ -465,7 +454,7 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) Integration::Log::LogMessage(Integration::Log::DebugInfo, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10 ); mContextAttribs.Clear(); - if( mIsKhrCreateContextSupported ) + if( mGlesVersion >= 30 ) { mContextAttribs.Reserve(5); mContextAttribs.PushBack( EGL_CONTEXT_MAJOR_VERSION_KHR ); @@ -477,7 +466,7 @@ bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) { mContextAttribs.Reserve(3); mContextAttribs.PushBack( EGL_CONTEXT_CLIENT_VERSION ); - mContextAttribs.PushBack( mGlesVersion / 10 ); + mContextAttribs.PushBack( 2 ); } mContextAttribs.PushBack( EGL_NONE ); diff --git a/dali/internal/graphics/gles/egl-implementation.h b/dali/internal/graphics/gles/egl-implementation.h index 2901b9e..03c35f4 100644 --- a/dali/internal/graphics/gles/egl-implementation.h +++ b/dali/internal/graphics/gles/egl-implementation.h @@ -239,7 +239,6 @@ private: bool mDepthBufferRequired; bool mStencilBufferRequired; bool mIsSurfacelessContextSupported; - bool mIsKhrCreateContextSupported; }; } // namespace Adaptor -- 2.7.4