From 47e41b024e325f69ed514e551a6824afa58f1db6 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Fri, 2 Oct 2009 18:13:26 +0200 Subject: gallium: Preparations for adding more PIPE_TRANSFER_* usage flags. Always test for PIPE_TRANSFER_READ/WRITE using the bit-wise and operator, and add a pipe_transfer_buffer_flags() helper for getting the buffer usage flags corresponding to them. --- src/gallium/drivers/r300/r300_screen.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/gallium/drivers/r300/r300_screen.c') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 8296d56840..f2659ca61f 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -345,16 +345,9 @@ static void* r300_transfer_map(struct pipe_screen* screen, { struct r300_texture* tex = (struct r300_texture*)transfer->texture; char* map; - unsigned flags = 0; - if (transfer->usage != PIPE_TRANSFER_WRITE) { - flags |= PIPE_BUFFER_USAGE_CPU_READ; - } - if (transfer->usage != PIPE_TRANSFER_READ) { - flags |= PIPE_BUFFER_USAGE_CPU_WRITE; - } - - map = pipe_buffer_map(screen, tex->buffer, flags); + map = pipe_buffer_map(screen, tex->buffer, + pipe_transfer_buffer_flags(transfer)); if (!map) { return NULL; -- cgit v1.2.3