Mesa (master): gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write.

Marek Olšák mareko at kemper.freedesktop.org
Tue Mar 15 14:42:18 UTC 2011


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

Author: Mathias Fröhlich <Mathias.Froehlich at web.de>
Date:   Thu Mar 10 06:46:32 2011 +0100

gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write.

Additionally, to discarding the whole buffer, use
PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write when the
write covers only part of the buffer.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>

---

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

diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index aed8ba7..ddb81b5 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -303,6 +303,8 @@ pipe_buffer_write(struct pipe_context *pipe,
 
    if (offset == 0 && size == buf->width0) {
       usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
+   } else {
+      usage |= PIPE_TRANSFER_DISCARD_RANGE;
    }
 
    u_box_1d(offset, size, &box);




More information about the mesa-commit mailing list