From 8303d6b28ec89297a6904d4e9753fccef3ba4e3b Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 19 Oct 2023 14:02:34 -0700 Subject: [PATCH] EGL: fix typos in config creation thankfully it didn't seem to cause harm. --- filament/backend/src/opengl/platforms/PlatformEGL.cpp | 6 +++--- .../backend/src/opengl/platforms/PlatformEGLAndroid.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/filament/backend/src/opengl/platforms/PlatformEGL.cpp b/filament/backend/src/opengl/platforms/PlatformEGL.cpp index 60652b5415..0a31b81f50 100644 --- a/filament/backend/src/opengl/platforms/PlatformEGL.cpp +++ b/filament/backend/src/opengl/platforms/PlatformEGL.cpp @@ -174,7 +174,7 @@ Driver* PlatformEGL::createDriver(void* sharedContext, const Platform::DriverCon // find a config we can use if we don't have "EGL_KHR_no_config_context" and that we can use // for the dummy pbuffer surface. - mEGLConfig = findSwapChainConfig(0); + mEGLConfig = findSwapChainConfig(SWAP_CHAIN_CONFIG_TRANSPARENT); if (UTILS_UNLIKELY(mEGLConfig == EGL_NO_CONFIG_KHR)) { goto error; // error already logged } @@ -348,7 +348,7 @@ EGLConfig PlatformEGL::findSwapChainConfig(uint64_t flags) const { if (ext.egl.KHR_create_context) { - configAttribs[EGL_RECORDABLE_ANDROID] |= EGL_OPENGL_ES3_BIT_KHR; + configAttribs[EGL_RENDERABLE_TYPE] |= EGL_OPENGL_ES3_BIT_KHR; } if (ext.egl.ANDROID_recordable) { @@ -569,7 +569,7 @@ EGLint& PlatformEGL::Config::operator[](EGLint name) { auto pos = std::find_if(mConfig.begin(), mConfig.end(), [name](auto&& v) { return v.first == name; }); if (pos == mConfig.end()) { - mConfig.insert(pos - 1, { name, EGL_NONE }); + mConfig.insert(pos - 1, { name, 0 }); pos = mConfig.end() - 2; } return pos->second; diff --git a/filament/backend/src/opengl/platforms/PlatformEGLAndroid.cpp b/filament/backend/src/opengl/platforms/PlatformEGLAndroid.cpp index c273b66d62..b61bbeab9a 100644 --- a/filament/backend/src/opengl/platforms/PlatformEGLAndroid.cpp +++ b/filament/backend/src/opengl/platforms/PlatformEGLAndroid.cpp @@ -185,7 +185,7 @@ AcquiredImage PlatformEGLAndroid::transformAcquiredImage(AcquiredImage source) n AcquiredImage acquiredImage; EGLDisplay display; }; - Closure* closure = new Closure(source, mEGLDisplay); + Closure* closure = new(std::nothrow) Closure(source, mEGLDisplay); auto patchedCallback = [](void* image, void* userdata) { Closure* closure = (Closure*)userdata; if (eglDestroyImageKHR(closure->display, (EGLImageKHR) image) == EGL_FALSE) {