Mesa (master): llvmpipe: No need to flush the caches for buffers.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sun Apr 25 22:41:54 UTC 2010


Module: Mesa
Branch: master
Commit: 2cd128ab443addeb6e013f80d7c3f6639a66b2f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2cd128ab443addeb6e013f80d7c3f6639a66b2f1

Author: José Fonseca <jfonseca at vmware.com>
Date:   Sun Apr 25 17:15:56 2010 +0100

llvmpipe: No need to flush the caches for buffers.

---

 src/gallium/drivers/llvmpipe/lp_flush.c |   24 +++++++++++++-----------
 src/gallium/drivers/llvmpipe/lp_flush.h |    2 +-
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c
index 470132d..644b821 100644
--- a/src/gallium/drivers/llvmpipe/lp_flush.c
+++ b/src/gallium/drivers/llvmpipe/lp_flush.c
@@ -103,7 +103,7 @@ llvmpipe_flush( struct pipe_context *pipe,
  */
 boolean
 llvmpipe_flush_resource(struct pipe_context *pipe,
-                        struct pipe_resource *texture,
+                        struct pipe_resource *resource,
                         unsigned face,
                         unsigned level,
                         unsigned flush_flags,
@@ -113,21 +113,23 @@ llvmpipe_flush_resource(struct pipe_context *pipe,
 {
    unsigned referenced;
 
-   referenced = pipe->is_resource_referenced(pipe, texture, face, level);
+   referenced = pipe->is_resource_referenced(pipe, resource, face, level);
 
    if ((referenced & PIPE_REFERENCED_FOR_WRITE) ||
        ((referenced & PIPE_REFERENCED_FOR_READ) && !read_only)) {
 
-      /*
-       * TODO: The semantics of these flush flags are too obtuse. They should
-       * disappear and the pipe driver should just ensure that all visible
-       * side-effects happen when they need to happen.
-       */
-      if (referenced & PIPE_REFERENCED_FOR_WRITE)
-         flush_flags |= PIPE_FLUSH_RENDER_CACHE;
+      if (resource->target != PIPE_BUFFER) {
+         /*
+          * TODO: The semantics of these flush flags are too obtuse. They should
+          * disappear and the pipe driver should just ensure that all visible
+          * side-effects happen when they need to happen.
+          */
+         if (referenced & PIPE_REFERENCED_FOR_WRITE)
+            flush_flags |= PIPE_FLUSH_RENDER_CACHE;
 
-      if (referenced & PIPE_REFERENCED_FOR_READ)
-         flush_flags |= PIPE_FLUSH_TEXTURE_CACHE;
+         if (referenced & PIPE_REFERENCED_FOR_READ)
+            flush_flags |= PIPE_FLUSH_TEXTURE_CACHE;
+      }
 
       if (cpu_access) {
          /*
diff --git a/src/gallium/drivers/llvmpipe/lp_flush.h b/src/gallium/drivers/llvmpipe/lp_flush.h
index 1b38820..7b60568 100644
--- a/src/gallium/drivers/llvmpipe/lp_flush.h
+++ b/src/gallium/drivers/llvmpipe/lp_flush.h
@@ -39,7 +39,7 @@ llvmpipe_flush(struct pipe_context *pipe, unsigned flags,
 
 boolean
 llvmpipe_flush_resource(struct pipe_context *pipe,
-                        struct pipe_resource *texture,
+                        struct pipe_resource *resource,
                         unsigned face,
                         unsigned level,
                         unsigned flush_flags,




More information about the mesa-commit mailing list