summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2015-08-08 15:21:03 +0200
committerMatthew Waters <matthew@centricular.com>2015-08-08 15:32:17 +0200
commit83995c0935b9809ea07dc2314145c3e1b1542e7a (patch)
tree2f0ba665ec1efbc7ec17e24e995e745eca3ba065 /gst-libs
parentc895f3f3b3b7a89be096eaa0b765635f0f6f590d (diff)
downloadgstreamer-plugins-bad-83995c0935b9809ea07dc2314145c3e1b1542e7a.tar.gz
context/glx: only use glXCreateContextAttribs for OpenGL 3 contexts
mesa for example when creating a GL 3.1 compatibility context overrides our context profile selection to create a core context.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/gl/x11/gstglcontext_glx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gst-libs/gst/gl/x11/gstglcontext_glx.c b/gst-libs/gst/gl/x11/gstglcontext_glx.c
index 0e4e67b83..e1e9fbbc2 100644
--- a/gst-libs/gst/gl/x11/gstglcontext_glx.c
+++ b/gst-libs/gst/gl/x11/gstglcontext_glx.c
@@ -248,21 +248,20 @@ gst_gl_context_glx_create_context (GstGLContext * context,
(gpointer) glXGetProcAddressARB ((const GLubyte *)
"glXCreateContextAttribsARB");
- if (create_context && context_glx->priv->glXCreateContextAttribsARB) {
+ if (!context_glx->glx_context && gl_api & GST_GL_API_OPENGL3 && create_context
+ && context_glx->priv->glXCreateContextAttribsARB) {
gint i;
for (i = 0; i < G_N_ELEMENTS (gl_versions); i++) {
- GstGLAPI selected_gl_api;
gint profileMask = 0;
gint contextFlags = 0;
- if (gl_api & GST_GL_API_OPENGL3 && (gl_versions[i].major > 3
+ if ((gl_versions[i].major > 3
|| (gl_versions[i].major == 3 && gl_versions[i].minor >= 2))) {
profileMask |= GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
- selected_gl_api = GST_GL_API_OPENGL3;
contextFlags |= GLX_CONTEXT_DEBUG_BIT_ARB;
} else {
- selected_gl_api = GST_GL_API_OPENGL;
+ break;
}
GST_DEBUG_OBJECT (context, "trying to create a GL %d.%d context",
@@ -274,11 +273,12 @@ gst_gl_context_glx_create_context (GstGLContext * context,
gl_versions[i].minor, contextFlags, profileMask);
if (context_glx->glx_context) {
- context_glx->priv->context_api = selected_gl_api;
+ context_glx->priv->context_api = GST_GL_API_OPENGL3;
break;
}
}
- } else {
+ }
+ if (!context_glx->glx_context && gl_api & GST_GL_API_OPENGL) {
context_glx->glx_context =
glXCreateContext (device, window_x11->visual_info,
(GLXContext) external_gl_context, TRUE);