From fd4a6dc06fcf8671d616af52025e19200c79e404 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 27 Sep 2016 17:15:12 -0400 Subject: [PATCH] glamor: Fall back to software for CopyPlane if we need to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glUniform4ui is available starting in GL{,ES} 3.0. Technically it's also in EXT_gpu_shader4, but that's not worth supporting. There was also a MESA_shading_language_130 spec proposed at one point; if that ever gets finished, we can update epoxy to know about it and fix up the feature check. Signed-off-by: Adam Jackson Reviewed-by: Michel Dänzer --- glamor/glamor.c | 2 ++ glamor/glamor_copy.c | 3 +++ glamor/glamor_priv.h | 1 + 3 files changed, 6 insertions(+) diff --git a/glamor/glamor.c b/glamor/glamor.c index 45cc0952e..7b3953660 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -616,6 +616,8 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->is_core_profile = gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility"); + glamor_priv->can_copyplane = (gl_version >= 30); + glamor_setup_debug_output(screen); glamor_priv->use_quads = (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) && diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c index 5b5f0e6b9..8a329d2f8 100644 --- a/glamor/glamor_copy.c +++ b/glamor/glamor_copy.c @@ -351,6 +351,9 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src, if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy)) goto bail_ctx; + if (bitplane && !glamor_priv->can_copyplane) + goto bail_ctx; + if (bitplane) { prog = &glamor_priv->copy_plane_prog; copy_facet = &glamor_facet_copyplane; diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index 2e491a689..27f95521d 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -201,6 +201,7 @@ typedef struct glamor_screen_private { Bool has_dual_blend; Bool has_texture_swizzle; Bool is_core_profile; + Bool can_copyplane; int max_fbo_size; GLuint one_channel_format;