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@web.de>
This commit is contained in:
Mathias Fröhlich
2011-03-10 06:46:32 +01:00
committed by Marek Olšák
parent baab835a1f
commit 65942e141f
+2
View File
@@ -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);