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;
}
}
}
-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 */
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,
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. */