1 #include "pipe/p_context.h"
2 #include "util/u_rect.h"
3 #include "util/u_inlines.h"
4 #include "util/u_transfer.h"
5 #include "util/u_memory.h"
7 /* One-shot transfer operation with data supplied in a user
8 * pointer. XXX: strides??
10 void u_default_transfer_inline_write( struct pipe_context *pipe,
11 struct pipe_resource *resource,
12 struct pipe_subresource sr,
14 const struct pipe_box *box,
17 unsigned slice_stride)
19 struct pipe_transfer *transfer = NULL;
22 transfer = pipe->get_transfer(pipe,
30 map = pipe_transfer_map(pipe, transfer);
34 assert(box->depth == 1); /* XXX: fix me */
38 transfer->stride, /* bytes? */
43 box->width, /* bytes? texels? */
48 pipe_transfer_unmap(pipe, transfer);
51 pipe_transfer_destroy(pipe, transfer);
55 boolean u_default_resource_get_handle(struct pipe_screen *screen,
56 struct pipe_resource *resource,
57 struct winsys_handle *handle)
64 void u_default_transfer_flush_region( struct pipe_context *pipe,
65 struct pipe_transfer *transfer,
66 const struct pipe_box *box)
68 /* This is a no-op implementation, nothing to do.
72 unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
73 struct pipe_resource *resource,
74 unsigned face, unsigned level)
79 struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
80 struct pipe_resource *resource,
81 struct pipe_subresource sr,
83 const struct pipe_box *box)
85 struct pipe_transfer *transfer = CALLOC_STRUCT(pipe_transfer);
89 transfer->resource = resource;
91 transfer->usage = usage;
94 /* Note strides are zero, this is ok for buffers, but not for
95 * textures 2d & higher at least.
100 void u_default_transfer_unmap( struct pipe_context *pipe,
101 struct pipe_transfer *transfer )
105 void u_default_transfer_destroy(struct pipe_context *pipe,
106 struct pipe_transfer *transfer)