dawn: Fix OpenGL context creation for Nvidia / Linux
Change 104120 enabled `EGL_EXT_create_context_robustness` to ensure that robustness is enabled for OpenGL.
Despite listing `EGL_EXT_create_context_robustness` in the extension list, Nvidia linux drivers will error with `EGL_BAD_ATTRIBUTE` when `EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT` is specified when requesting an OpenGL context (ES works fine!)
EGL promoted this extension to core in EGL 1.5, and requesting `EGL_CONTEXT_OPENGL_ROBUST_ACCESS` keeps Nvidia happy - so use this instead.
Note: We already require EGL 1.5 for EGLImage.
Change-Id: I6012773aef0d53b1d147228f40e0348865e98107
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106884
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/dawn/native/opengl/ContextEGL.cpp b/src/dawn/native/opengl/ContextEGL.cpp
index ab42663..d0fcba6 100644
--- a/src/dawn/native/opengl/ContextEGL.cpp
+++ b/src/dawn/native/opengl/ContextEGL.cpp
@@ -19,10 +19,6 @@
#include "dawn/native/opengl/UtilsEGL.h"
-#ifndef EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT
-#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
-#endif
-
namespace dawn::native::opengl {
ResultOrError<std::unique_ptr<ContextEGL>> ContextEGL::Create(const EGLFunctions& egl,
@@ -76,11 +72,11 @@
major,
EGL_CONTEXT_MINOR_VERSION,
minor,
- EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT,
+ EGL_CONTEXT_OPENGL_ROBUST_ACCESS, // Core in EGL 1.5
EGL_TRUE,
EGL_NONE,
- EGL_NONE,
};
+
EGLContext context = egl.CreateContext(display, config, EGL_NO_CONTEXT, attrib_list);
DAWN_TRY(CheckEGL(egl, context != EGL_NO_CONTEXT, "eglCreateContext"));