diff options
author | Adel Gadllah <adel.gadllah@gmail.com> | 2014-01-06 15:29:38 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2014-01-20 17:15:15 +0000 |
commit | 223d28ba630fa964f810d5b64b32dc5c3f5c1a64 (patch) | |
tree | dd4c71527db9b80496d8d5609b0931e3fc779aa6 | |
parent | 802085fd15bab2250a9a79adddaa0fd98484ebc2 (diff) | |
download | cogl-223d28ba630fa964f810d5b64b32dc5c3f5c1a64.tar.gz |
winsys-glx: Reenable swap_region for llvmpipe and swrast
The bug that prevented MESA_copy_sub_buffer to work for swrast /
llvmpipe got fixed in mesa 10.1 git so enable it for mesa 10.1+.
https://bugzilla.gnome.org/show_bug.cgi?id=721450
When landing the patch, it was tweaked to #include "cogl-version.h" to
avoid a compiler warning about COGL_VERSION_ENCODE being implicitly
defined. -- Robert Bragg
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit e7e216b1d3d151acf3fed619bd759692a989b4b4)
-rw-r--r-- | cogl/winsys/cogl-winsys-glx.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c index 8395ed84..d24c46a0 100644 --- a/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/winsys/cogl-winsys-glx.c @@ -52,6 +52,7 @@ #include "cogl-winsys-glx-private.h" #include "cogl-error-private.h" #include "cogl-poll-private.h" +#include "cogl-version.h" #include <stdlib.h> #include <sys/types.h> @@ -812,24 +813,27 @@ update_winsys_features (CoglContext *context, CoglError **error) if (glx_renderer->glXCopySubBuffer || context->glBlitFramebuffer) { - CoglGpuInfoArchitecture arch; + CoglGpuInfo *info = &context->gpu; + CoglGpuInfoArchitecture arch = info->architecture; - /* XXX: ONGOING BUG: - * (Don't change the line above since we use this to grep for - * un-resolved bug workarounds as part of the release process.) - * + COGL_FLAGS_SET (context->winsys_features, COGL_WINSYS_FEATURE_SWAP_REGION, TRUE); + + /* * "The "drisw" binding in Mesa for loading sofware renderers is * broken, and neither glBlitFramebuffer nor glXCopySubBuffer * work correctly." * - ajax * - https://bugzilla.gnome.org/show_bug.cgi?id=674208 * - * This is broken in software Mesa at least as of 7.10 + * This is broken in software Mesa at least as of 7.10 and got + * fixed in Mesa 10.1 */ - arch = context->gpu.architecture; - if (arch != COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE && - arch != COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE && - arch != COGL_GPU_INFO_ARCHITECTURE_SWRAST) + + if (info->driver_package == COGL_GPU_INFO_DRIVER_PACKAGE_MESA && + info->driver_package_version < COGL_VERSION_ENCODE (10, 1, 0) && + (arch == COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE || + arch == COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE || + arch == COGL_GPU_INFO_ARCHITECTURE_SWRAST)) { COGL_FLAGS_SET (context->winsys_features, COGL_WINSYS_FEATURE_SWAP_REGION, TRUE); |