diff options
author | Dave Airlie <airlied@redhat.com> | 2016-01-11 14:00:35 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-01-21 06:50:02 +1000 |
commit | f70d26d004f0d7db2ebe950527a38a2ba2996c63 (patch) | |
tree | cdad882a2a1db8afa1490d4a2fb6d411222e48fb | |
parent | ed76c1d68a39cedd7c41e58eead63974a0142cf4 (diff) |
glamor: add core profile support. (v2)
Glamor works out from the profile if it is
core.
This flag is used to disable quads for rendering.
v1.1: split long line + make whitespace conform (Michel)
v1.2: add GL 3.1 version defines
v2: move to having glamor work out the profile.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | glamor/glamor.c | 8 | ||||
-rw-r--r-- | glamor/glamor.h | 4 | ||||
-rw-r--r-- | glamor/glamor_priv.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c index 25967b698..e9c1d9ed3 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -579,9 +579,15 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->has_dual_blend = epoxy_has_gl_extension("GL_ARB_blend_func_extended"); + /* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */ + glamor_priv->is_core_profile = + gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility"); + glamor_setup_debug_output(screen); - glamor_priv->use_quads = (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); + glamor_priv->use_quads = (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) && + !glamor_priv->is_core_profile; + /* Driver-specific hack: Avoid using GL_QUADS on VC4, where * they'll be emulated more expensively than we can with our * cached IB. diff --git a/glamor/glamor.h b/glamor/glamor.h index a4e065576..a73e9eff0 100644 --- a/glamor/glamor.h +++ b/glamor/glamor.h @@ -66,6 +66,10 @@ typedef enum glamor_pixmap_type { #define GLAMOR_VALID_FLAGS (GLAMOR_USE_EGL_SCREEN \ | GLAMOR_NO_DRI3) +/* until we need geometry shaders GL3.1 should suffice. */ +#define GLAMOR_GL_CORE_VER_MAJOR 3 +#define GLAMOR_GL_CORE_VER_MINOR 1 + /* @glamor_init: Initialize glamor internal data structure. * * @screen: Current screen pointer. diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index 5e3d85de8..558ed6392 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -210,6 +210,7 @@ typedef struct glamor_screen_private { Bool use_quads; Bool has_vertex_array_object; Bool has_dual_blend; + Bool is_core_profile; int max_fbo_size; GLuint one_channel_format; |