r300g: use u_default_transfer_inline_write
authorMarek Olšák <maraeo@gmail.com>
Thu, 26 Apr 2012 10:07:54 +0000 (12:07 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 29 Apr 2012 12:48:45 +0000 (14:48 +0200)
src/gallium/drivers/r300/r300_resource.c
src/gallium/drivers/r300/r300_screen_buffer.c
src/gallium/drivers/r300/r300_texture.c

index 6593474b1f052ebd4769381696239dfca0ad6240..823bc0fa775b8619cd20fc594773538deda60f0c 100644 (file)
@@ -45,7 +45,7 @@ void r300_init_resource_functions(struct r300_context *r300)
    r300->context.transfer_flush_region = u_default_transfer_flush_region;
    r300->context.transfer_unmap = u_transfer_unmap_vtbl;
    r300->context.transfer_destroy = u_transfer_destroy_vtbl;
-   r300->context.transfer_inline_write = u_transfer_inline_write_vtbl;
+   r300->context.transfer_inline_write = u_default_transfer_inline_write;
    r300->context.create_surface = r300_create_surface;
    r300->context.surface_destroy = r300_surface_destroy;
 }
index bb2c7c14bd8069c48256dd6cf6cb90f052ec6f62..a3b09500d4bc46c2e1519ebdbbe1c36a01b3c745 100644 (file)
@@ -140,34 +140,6 @@ static void r300_buffer_transfer_unmap( struct pipe_context *pipe,
     }
 }
 
-static void r300_buffer_transfer_inline_write(struct pipe_context *pipe,
-                                              struct pipe_resource *resource,
-                                              unsigned level,
-                                              unsigned usage,
-                                              const struct pipe_box *box,
-                                              const void *data,
-                                              unsigned stride,
-                                              unsigned layer_stride)
-{
-    struct r300_context *r300 = r300_context(pipe);
-    struct radeon_winsys *rws = r300->screen->rws;
-    struct r300_resource *rbuf = r300_resource(resource);
-    uint8_t *map = NULL;
-
-    if (rbuf->constant_buffer) {
-        memcpy(rbuf->constant_buffer + box->x, data, box->width);
-        return;
-    }
-    assert(rbuf->b.b.user_ptr == NULL);
-
-    map = rws->buffer_map(rbuf->cs_buf, r300->cs,
-                          PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
-
-    memcpy(map + box->x, data, box->width);
-
-    rws->buffer_unmap(rbuf->cs_buf);
-}
-
 static const struct u_resource_vtbl r300_buffer_vtbl =
 {
    NULL,                               /* get_handle */
@@ -177,7 +149,7 @@ static const struct u_resource_vtbl r300_buffer_vtbl =
    r300_buffer_transfer_map,           /* transfer_map */
    NULL,                               /* transfer_flush_region */
    r300_buffer_transfer_unmap,         /* transfer_unmap */
-   r300_buffer_transfer_inline_write   /* transfer_inline_write */
+   NULL   /* transfer_inline_write */
 };
 
 struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
index 8c5ee058b9e9229d0f230fb423a49e71fd12b0fa..c9af04fac5d76a40a0a7d2818b67a8c9a706fa2f 100644 (file)
@@ -863,7 +863,7 @@ static const struct u_resource_vtbl r300_texture_vtbl =
     r300_texture_transfer_map,      /* transfer_map */
     NULL,                           /* transfer_flush_region */
     r300_texture_transfer_unmap,    /* transfer_unmap */
-    u_default_transfer_inline_write /* transfer_inline_write */
+    NULL /* transfer_inline_write */
 };
 
 /* The common texture constructor. */