summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-09-10 19:05:08 -0700
committerEric Anholt <eric@anholt.net>2016-01-26 12:04:10 -0800
commit98c3504dcfcec227b9c7798a0bd287941cec0691 (patch)
tree5143c6a006c50a13bff518d2248d45b8509030aa /hw/kdrive
parent564d9f0f8c17bb3c13aa3ca36da7825454dc5de3 (diff)
ephyr: Create 3.1 core profile context if possible (v3)
On desktop GL, ask for a 3.1 core profile context if that's available, otherwise create a generic context. v2: tell glamor the profile is a core one. v2.1: add/use GL version defines v3: let glamor work out core itself Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/ephyr/ephyr_glamor_glx.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index 30c524564..b9fe8d127 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_glx.c
+++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c
@@ -41,6 +41,10 @@
#include "os.h"
#include <X11/Xproto.h>
+/* until we need geometry shaders GL3.1 should suffice. */
+/* Xephyr has it's own copy of this for build reasons */
+#define GLAMOR_GL_CORE_VER_MAJOR 3
+#define GLAMOR_GL_CORE_VER_MINOR 1
/** @{
*
* global state for Xephyr with glamor.
@@ -319,7 +323,19 @@ ephyr_glamor_glx_screen_init(xcb_window_t win)
"GLX_EXT_create_context_es2_profile\n");
}
} else {
- ctx = glXCreateContext(dpy, visual_info, NULL, True);
+ static const int context_attribs[] = {
+ GLX_CONTEXT_PROFILE_MASK_ARB,
+ GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+ GLX_CONTEXT_MAJOR_VERSION_ARB,
+ GLAMOR_GL_CORE_VER_MAJOR,
+ GLX_CONTEXT_MINOR_VERSION_ARB,
+ GLAMOR_GL_CORE_VER_MINOR,
+ 0,
+ };
+ ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True,
+ context_attribs);
+ if (!ctx)
+ ctx = glXCreateContext(dpy, visual_info, NULL, True);
}
if (ctx == NULL)
FatalError("glXCreateContext failed\n");