cell: adapt to context texture transfers (untested)
authorRoland Scheidegger <sroland@vmware.com>
Thu, 11 Mar 2010 17:40:25 +0000 (18:40 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 11 Mar 2010 17:40:25 +0000 (18:40 +0100)
src/gallium/drivers/cell/ppu/cell_context.c
src/gallium/drivers/cell/ppu/cell_texture.c
src/gallium/drivers/cell/ppu/cell_texture.h

index afcea616d5934c8743c578742184865566d11aa5..f6cb1fc9be7ce227f1690bba507bb50a2199c82c 100644 (file)
@@ -158,6 +158,7 @@ cell_create_context(struct pipe_screen *screen,
    cell_init_shader_functions(cell);
    cell_init_surface_functions(cell);
    cell_init_vertex_functions(cell);
+   cell_init_texture_transfer_funcs(cell);
 
    cell->draw = cell_draw_create(cell);
 
index c8a1acd86a913d2c0501c3b6cb66005f2c0e2ac6..c65c3b4f88522bb6c211470c83362439947f3578 100644 (file)
@@ -355,7 +355,7 @@ cell_tex_surface_destroy(struct pipe_surface *surf)
  * back out for glGetTexImage).
  */
 static struct pipe_transfer *
-cell_get_tex_transfer(struct pipe_screen *screen,
+cell_get_tex_transfer(struct pipe_context *ctx,
                       struct pipe_texture *texture,
                       unsigned face, unsigned level, unsigned zslice,
                       enum pipe_transfer_usage usage,
@@ -402,7 +402,7 @@ cell_get_tex_transfer(struct pipe_screen *screen,
 
 
 static void 
-cell_tex_transfer_destroy(struct pipe_transfer *t)
+cell_tex_transfer_destroy(struct pipe_context *ctx, struct pipe_transfer *t)
 {
    struct cell_transfer *transfer = cell_transfer(t);
    /* Effectively do the texture_update work here - if texture images
@@ -419,7 +419,7 @@ cell_tex_transfer_destroy(struct pipe_transfer *t)
  * Return pointer to texture image data in linear layout.
  */
 static void *
-cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer)
+cell_transfer_map(struct pipe_context *ctx, struct pipe_transfer *transfer)
 {
    struct cell_transfer *ctrans = cell_transfer(transfer);
    struct pipe_texture *pt = transfer->texture;
@@ -471,7 +471,7 @@ cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer)
  * to tiled data.
  */
 static void
-cell_transfer_unmap(struct pipe_screen *screen,
+cell_transfer_unmap(struct pipe_context *ctx,
                     struct pipe_transfer *transfer)
 {
    struct cell_transfer *ctrans = cell_transfer(transfer);
@@ -560,11 +560,14 @@ cell_init_screen_texture_funcs(struct pipe_screen *screen)
    screen->get_tex_surface = cell_get_tex_surface;
    screen->tex_surface_destroy = cell_tex_surface_destroy;
 
-   screen->get_tex_transfer = cell_get_tex_transfer;
-   screen->tex_transfer_destroy = cell_tex_transfer_destroy;
-
-   screen->transfer_map = cell_transfer_map;
-   screen->transfer_unmap = cell_transfer_unmap;
-
    screen->flush_frontbuffer = cell_flush_frontbuffer;
 }
+
+void
+cell_init_texture_transfer_funcs(struct cell_context *cell)
+{
+   cell->pipe.get_tex_transfer = cell_get_tex_transfer;
+   cell->pipe.tex_transfer_destroy = cell_tex_transfer_destroy;
+   cell->pipe.transfer_map = cell_transfer_map;
+   cell->pipe.transfer_unmap = cell_transfer_unmap;
+}
index 2be057931220b2fb763a73636ee1fae031106012..ac0b9167750bcb620cb5d204e44c49477ca8406d 100644 (file)
@@ -95,5 +95,7 @@ cell_transfer(struct pipe_transfer *pt)
 extern void
 cell_init_screen_texture_funcs(struct pipe_screen *screen);
 
+extern void
+cell_init_texture_transfer_funcs(struct cell_context *cell);
 
 #endif /* CELL_TEXTURE_H */