diff options
author | José Fonseca <[email protected]> | 2009-03-26 10:54:48 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-03-26 11:16:56 +0000 |
commit | ca9d2044a2390267477f1e7118b16f21f2557dd3 (patch) | |
tree | 1a0b7b64a867305c270e4f18f49d06e93d5191fa /src/gallium/state_trackers | |
parent | f4520277e1a5113146fb99e831d515ba7f74c1f8 (diff) |
python: Use pipe_buffer_read/write.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/python/p_texture.i | 14 |
1 files 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); } }; |