Mesa (master): util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Mar 9 11:58:42 UTC 2011


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Feb 10 20:54:18 2011 +0000

util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write.

---

 src/gallium/auxiliary/util/u_inlines.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 98889fb..aed8ba7 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -299,13 +299,18 @@ pipe_buffer_write(struct pipe_context *pipe,
                   const void *data)
 {
    struct pipe_box box;
+   unsigned usage = PIPE_TRANSFER_WRITE;
+
+   if (offset == 0 && size == buf->width0) {
+      usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
+   }
 
    u_box_1d(offset, size, &box);
 
    pipe->transfer_inline_write( pipe,
                                 buf,
                                 0,
-                                PIPE_TRANSFER_WRITE,
+                                usage,
                                 &box,
                                 data,
                                 size,




More information about the mesa-commit mailing list