diff options
author | michal <[email protected]> | 2009-03-16 06:44:16 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2009-03-16 08:18:03 +0100 |
commit | 38b074495a9f03057c40b814b65d0ca5af6118a4 (patch) | |
tree | 1c572b3681326ed2d687298d8141ddb8a53f6f37 /src | |
parent | f6c3edb308316483b64d93b912bee670eac9f5ad (diff) |
python: Use transfer objects to initialise texture data.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/python/st_device.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 65cfa7f46fc..3fe739090dc 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -231,7 +231,7 @@ st_context_create(struct st_device *st_dev) { struct pipe_screen *screen = st_dev->screen; struct pipe_texture templat; - struct pipe_surface *surface; + struct pipe_transfer *transfer; unsigned i; memset( &templat, 0, sizeof( templat ) ); @@ -247,17 +247,21 @@ st_context_create(struct st_device *st_dev) st_ctx->default_texture = screen->texture_create( screen, &templat ); if(st_ctx->default_texture) { - surface = screen->get_tex_surface( screen, - st_ctx->default_texture, 0, 0, 0, - PIPE_BUFFER_USAGE_CPU_WRITE ); - if(surface) { + transfer = screen->get_tex_transfer(screen, + st_ctx->default_texture, + 0, 0, 0, + PIPE_TRANSFER_WRITE, + 0, 0, + st_ctx->default_texture->width[0], + st_ctx->default_texture->height[0]); + if (transfer) { uint32_t *map; - map = (uint32_t *) pipe_surface_map(surface, PIPE_BUFFER_USAGE_CPU_WRITE ); + map = (uint32_t *) screen->transfer_map(screen, transfer); if(map) { *map = 0x00000000; - pipe_surface_unmap( surface ); + screen->transfer_unmap(screen, transfer); } - pipe_surface_reference(&surface, NULL); + screen->tex_transfer_destroy(transfer); } } |