[PATCH xserver] glamor: Fall back to software for CopyPlane if we need to

Adam Jackson ajax at redhat.com
Tue Sep 27 21:15:12 UTC 2016


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 <ajax at redhat.com>
---
 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 45cc095..7b39536 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 5b5f0e6..8a329d2 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 2e491a6..27f9552 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;
-- 
2.9.3



More information about the xorg-devel mailing list