Dave Airlie <[email protected]> writes: > From: Keith Packard <[email protected]> > > On desktop GL, Ask for a 3.3 core profile context if that's available, > otherwise create a generic context. > > v2: tell glamor the profile is a core one. > > Signed-off-by: Keith Packard <[email protected]> > Signed-off-by: Dave Airlie <[email protected]> > --- > hw/kdrive/ephyr/ephyr_glamor_glx.c | 19 +++++++++++++++++-- > hw/kdrive/ephyr/ephyr_glamor_glx.h | 2 +- > hw/kdrive/ephyr/hostx.c | 7 +++++-- > 3 files changed, 23 insertions(+), 5 deletions(-) > > diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c > b/hw/kdrive/ephyr/ephyr_glamor_glx.c > index 30c5245..674e7f5 100644 > --- a/hw/kdrive/ephyr/ephyr_glamor_glx.c > +++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c > @@ -277,7 +277,7 @@ ephyr_glamor_process_event(xcb_generic_event_t *xev) > } > > struct ephyr_glamor * > -ephyr_glamor_glx_screen_init(xcb_window_t win) > +ephyr_glamor_glx_screen_init(xcb_window_t win, Bool *profile_is_core) > { > static const float position[] = { > -1, -1, > @@ -295,6 +295,7 @@ ephyr_glamor_glx_screen_init(xcb_window_t win) > struct ephyr_glamor *glamor; > GLXWindow glx_win; > > + *profile_is_core = FALSE; > glamor = calloc(1, sizeof(struct ephyr_glamor)); > if (!glamor) { > FatalError("malloc"); > @@ -319,7 +320,21 @@ 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, > + 3, > + GLX_CONTEXT_MINOR_VERSION_ARB, > + 3, > + 0, > + }; > + ctx = glXCreateContextAttribsARB(dpy, fb_config, NULL, True, > + context_attribs); > + if (!ctx) > + ctx = glXCreateContext(dpy, visual_info, NULL, True); > + else > + *profile_is_core = TRUE; > }
Before using the new function, we need to check
epoxy_has_glx_extension("GLX_ARB_create_context")
signature.asc
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
