From ca9d2044a2390267477f1e7118b16f21f2557dd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 26 Mar 2009 10:54:48 +0000 Subject: [PATCH] python: Use pipe_buffer_read/write. --- src/gallium/state_trackers/python/p_texture.i | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/gallium/state_trackers/python/p_texture.i b/src/gallium/state_trackers/python/p_texture.i index de03f8f446c..4648af691d1 100644 --- a/src/gallium/state_trackers/python/p_texture.i +++ b/src/gallium/state_trackers/python/p_texture.i @@ -327,7 +327,6 @@ struct st_buffer { void read(char **STRING, int *LENGTH) { struct pipe_screen *screen = $self->st_dev->screen; - const char *map; assert(p_atomic_read(&$self->buffer->reference.count) > 0); @@ -336,18 +335,13 @@ struct st_buffer { if(!*STRING) return; - map = pipe_buffer_map(screen, $self->buffer, PIPE_BUFFER_USAGE_CPU_READ); - if(map) { - memcpy(*STRING, map, $self->buffer->size); - pipe_buffer_unmap(screen, $self->buffer); - } + pipe_buffer_read(screen, $self->buffer, 0, $self->buffer->size, STRING); } %cstring_input_binary(const char *STRING, unsigned LENGTH); void write(const char *STRING, unsigned LENGTH, unsigned offset = 0) { struct pipe_screen *screen = $self->st_dev->screen; - char *map; assert(p_atomic_read(&$self->buffer->reference.count) > 0); @@ -361,10 +355,6 @@ struct st_buffer { return; } - map = pipe_buffer_map(screen, $self->buffer, PIPE_BUFFER_USAGE_CPU_WRITE); - if(map) { - memcpy(map + offset, STRING, LENGTH); - pipe_buffer_unmap(screen, $self->buffer); - } + pipe_buffer_write(screen, $self->buffer, offset, LENGTH, STRING); } }; -- 2.30.2