[Mesa-dev] [PATCH shaderdb 1/2] run: fall back to v3.1 core ctx if v3.2 fails
Rob Clark
robdclark at gmail.com
Sat Jan 27 18:06:16 UTC 2018
Signed-off-by: Rob Clark <robdclark at gmail.com>
---
run.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/run.c b/run.c
index 69fe23d..20a0a6a 100644
--- a/run.c
+++ b/run.c
@@ -520,6 +520,18 @@ main(int argc, char **argv)
};
EGLContext core_ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT,
attribs);
+
+ if (core_ctx == EGL_NO_CONTEXT) {
+ static const EGLint attribs_31[] = {
+ EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR,
+ EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR,
+ EGL_CONTEXT_MAJOR_VERSION_KHR, 3,
+ EGL_CONTEXT_MINOR_VERSION_KHR, 1,
+ EGL_NONE
+ };
+ core_ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs_31);
+ }
+
if (core_ctx != EGL_NO_CONTEXT &&
eglMakeCurrent(egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, core_ctx)) {
int num_extensions;
--
2.14.3
More information about the mesa-dev
mailing list