From: michal Date: Mon, 16 Mar 2009 05:44:16 +0000 (+0100) Subject: python: Use transfer objects to initialise texture data. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38b074495a9f03057c40b814b65d0ca5af6118a4;p=mesa.git python: Use transfer objects to initialise texture data. --- 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); } }