summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-09-27 17:15:12 -0400
committerAdam Jackson <ajax@redhat.com>2016-09-28 12:52:05 -0400
commitfd4a6dc06fcf8671d616af52025e19200c79e404 (patch)
tree01da13a222a2a326371b0066f2689c990c518b37
parentc49e820f796c27cbd2907709576a3fb672acd453 (diff)
glamor: Fall back to software for CopyPlane if we need to
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@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--glamor/glamor.c2
-rw-r--r--glamor/glamor_copy.c3
-rw-r--r--glamor/glamor_priv.h1
3 files changed, 6 insertions, 0 deletions
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;