summaryrefslogtreecommitdiff
path: root/Source/Core/Common/GL/GLInterface/EGL.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2017-07-30 00:42:36 -0700
committerGitHub <noreply@github.com>2017-07-30 00:42:36 -0700
commit5bad2ee4a4129e734ff4f4d861cedc4cd573df55 (patch)
treecd3c3ccc6e35417858499449d774670c3983cb13 /Source/Core/Common/GL/GLInterface/EGL.cpp
parent5e6d5493165d1214f513b91eaeb4e162d21fdd3e (diff)
parent357c55442f3dbdf6f23d16af5362d1a615cb84c1 (diff)
Merge pull request #5832 from stenzek/ubershader-prereq
Ubershader prerequisites
Diffstat (limited to 'Source/Core/Common/GL/GLInterface/EGL.cpp')
-rw-r--r--Source/Core/Common/GL/GLInterface/EGL.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/Source/Core/Common/GL/GLInterface/EGL.cpp b/Source/Core/Common/GL/GLInterface/EGL.cpp
index 32cd705d73..8e85511fc7 100644
--- a/Source/Core/Common/GL/GLInterface/EGL.cpp
+++ b/Source/Core/Common/GL/GLInterface/EGL.cpp
@@ -212,7 +212,10 @@ bool cInterfaceEGL::Create(void* window_handle, bool stereo, bool core)
egl_ctx = eglCreateContext(egl_dpy, m_config, EGL_NO_CONTEXT, &core_attribs[0]);
if (egl_ctx)
+ {
+ m_attribs = std::move(core_attribs);
break;
+ }
}
}
@@ -220,6 +223,7 @@ bool cInterfaceEGL::Create(void* window_handle, bool stereo, bool core)
{
m_core = false;
egl_ctx = eglCreateContext(egl_dpy, m_config, EGL_NO_CONTEXT, &ctx_attribs[0]);
+ m_attribs = std::move(ctx_attribs);
}
if (!egl_ctx)
@@ -255,31 +259,13 @@ bool cInterfaceEGL::Create(cInterfaceBase* main_context)
m_is_shared = true;
m_has_handle = false;
- EGLint ctx_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
-
- switch (egl_context->GetMode())
- {
- case GLInterfaceMode::MODE_OPENGL:
- ctx_attribs[0] = EGL_NONE;
- break;
- case GLInterfaceMode::MODE_OPENGLES2:
- ctx_attribs[1] = 2;
- break;
- case GLInterfaceMode::MODE_OPENGLES3:
- ctx_attribs[1] = 3;
- break;
- default:
- INFO_LOG(VIDEO, "Unknown opengl mode set");
- return false;
- break;
- }
-
if (egl_context->GetMode() == GLInterfaceMode::MODE_OPENGL)
eglBindAPI(EGL_OPENGL_API);
else
eglBindAPI(EGL_OPENGL_ES_API);
- egl_ctx = eglCreateContext(egl_dpy, m_config, egl_context->egl_ctx, ctx_attribs);
+ egl_ctx =
+ eglCreateContext(egl_dpy, m_config, egl_context->egl_ctx, egl_context->m_attribs.data());
if (!egl_ctx)
{
INFO_LOG(VIDEO, "Error: eglCreateContext failed 0x%04x", eglGetError());