r600g: use u_default_transfer_inline_write for all resource types
authorMarek Olšák <maraeo@gmail.com>
Sun, 26 Feb 2012 18:00:26 +0000 (19:00 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 27 Feb 2012 15:22:34 +0000 (16:22 +0100)
src/gallium/drivers/r600/r600_buffer.c
src/gallium/drivers/r600/r600_resource.c
src/gallium/drivers/r600/r600_texture.c

index 2fc93e806b664a641f8eeefbf1e122ba5975a0cc..454d448beed80099a29b383e0350f08a8450a02b 100644 (file)
@@ -111,29 +111,6 @@ static void r600_transfer_destroy(struct pipe_context *ctx,
        util_slab_free(&rctx->pool_transfers, transfer);
 }
 
-static void r600_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 r600_context *rctx = (struct r600_context*)pipe;
-       struct r600_resource *rbuffer = r600_resource(resource);
-       uint8_t *map = NULL;
-
-       assert(rbuffer->b.user_ptr == NULL);
-
-       map = rctx->ws->buffer_map(rbuffer->buf, rctx->cs,
-                                  PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
-
-       memcpy(map + box->x, data, box->width);
-
-       rctx->ws->buffer_unmap(rbuffer->buf);
-}
-
 static const struct u_resource_vtbl r600_buffer_vtbl =
 {
        u_default_resource_get_handle,          /* get_handle */
@@ -143,7 +120,7 @@ static const struct u_resource_vtbl r600_buffer_vtbl =
        r600_buffer_transfer_map,               /* transfer_map */
        r600_buffer_transfer_flush_region,      /* transfer_flush_region */
        r600_buffer_transfer_unmap,             /* transfer_unmap */
-       r600_buffer_transfer_inline_write       /* transfer_inline_write */
+       NULL                                    /* transfer_inline_write */
 };
 
 bool r600_init_resource(struct r600_screen *rscreen,
index 1dc63e927a93c0c3d6fa9fe29fb93f4fca8f6a2e..39c9f4274db679e09f0db72ef32ddfe3e4289376 100644 (file)
@@ -60,7 +60,7 @@ void r600_init_context_resource_functions(struct r600_context *r600)
        r600->context.transfer_flush_region = u_transfer_flush_region_vtbl;
        r600->context.transfer_unmap = u_transfer_unmap_vtbl;
        r600->context.transfer_destroy = u_transfer_destroy_vtbl;
-       r600->context.transfer_inline_write = u_transfer_inline_write_vtbl;
+       r600->context.transfer_inline_write = u_default_transfer_inline_write;
 }
 
 uint64_t r600_resource_va(struct pipe_screen *screen, struct pipe_resource *resource)
index 4687f7ef3c189a4092209a8672a5cae1521a4670..6ce04a42b7d85d6a0f7bddc3aa0ee9bad7c91c36 100644 (file)
@@ -491,7 +491,7 @@ static const struct u_resource_vtbl r600_texture_vtbl =
        r600_texture_transfer_map,      /* transfer_map */
        u_default_transfer_flush_region,/* transfer_flush_region */
        r600_texture_transfer_unmap,    /* transfer_unmap */
-       u_default_transfer_inline_write /* transfer_inline_write */
+       NULL                            /* transfer_inline_write */
 };
 
 static struct r600_resource_texture *