[gegl/gsoc2009-gpu] GeglBufferIterator: Disable iteration on GPU data when GPU acceleration is disabled
- From: Jerson Michael Perpetua <jperpetua src gnome org>
- To: svn-commits-list gnome org
- Subject: [gegl/gsoc2009-gpu] GeglBufferIterator: Disable iteration on GPU data when GPU acceleration is disabled
- Date: Tue, 7 Jul 2009 17:47:59 +0000 (UTC)
commit 70ac56eb6cfdf412662a654803c0a9400b9db15f
Author: Jerson Michael Perpetua <jersonperpetua gmail com>
Date: Mon Jul 6 05:26:34 2009 +0800
GeglBufferIterator: Disable iteration on GPU data when GPU acceleration is disabled
gegl/buffer/gegl-buffer-iterator.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index 58f5f16..7e196b2 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -172,6 +172,7 @@ gulp:
i->tile = NULL;
i->sub_data = NULL;
+ i->gpu_data = NULL;
}
memset (&i->subrect, 0, sizeof (GeglRectangle));
@@ -290,10 +291,19 @@ gegl_buffer_iterator_add (GeglBufferIterator *iterator,
lock_mode |= GEGL_TILE_LOCK_READ;
if (flags & GEGL_BUFFER_WRITE)
lock_mode |= GEGL_TILE_LOCK_WRITE;
- if (flags & GEGL_BUFFER_GPU_READ)
- lock_mode |= GEGL_TILE_LOCK_GPU_READ;
- if (flags & GEGL_BUFFER_GPU_WRITE)
- lock_mode |= GEGL_TILE_LOCK_GPU_WRITE;
+
+ if (gegl_gpu_is_accelerated ())
+ {
+ if (flags & GEGL_BUFFER_GPU_READ)
+ lock_mode |= GEGL_TILE_LOCK_GPU_READ;
+ if (flags & GEGL_BUFFER_GPU_WRITE)
+ lock_mode |= GEGL_TILE_LOCK_GPU_WRITE;
+ }
+ else
+ /* do not allow iteration on GPU data when GPU acceleration
+ * is disabled
+ */
+ flags &= ~GEGL_BUFFER_GPU_READ & ~GEGL_BUFFER_GPU_WRITE;
if (self == 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]