From 65942e141fc3da760b53248eafdd876a45b592d4 Mon Sep 17 00:00:00 2001 From: Mathias Fröhlich Date: Thu, 10 Mar 2011 06:46:32 +0100 Subject: gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gallium/auxiliary/util/u_inlines.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index aed8ba7df4..ddb81b5b95 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); -- cgit v1.2.3