revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / workbench / libs / mesa / src / gallium / auxiliary / util / u_resource.c
blob50a7cd4d55b0b9356c99cfdf8ebd4d73ad7121e3
3 #include "util/u_inlines.h"
4 #include "util/u_transfer.h"
6 static INLINE struct u_resource *
7 u_resource( struct pipe_resource *res )
9 return (struct u_resource *)res;
12 boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
13 struct pipe_resource *resource,
14 struct winsys_handle *handle)
16 struct u_resource *ur = u_resource(resource);
17 return ur->vtbl->resource_get_handle(screen, resource, handle);
20 void u_resource_destroy_vtbl(struct pipe_screen *screen,
21 struct pipe_resource *resource)
23 struct u_resource *ur = u_resource(resource);
24 ur->vtbl->resource_destroy(screen, resource);
27 struct pipe_transfer *u_get_transfer_vtbl(struct pipe_context *context,
28 struct pipe_resource *resource,
29 unsigned level,
30 unsigned usage,
31 const struct pipe_box *box)
33 struct u_resource *ur = u_resource(resource);
34 return ur->vtbl->get_transfer(context, resource, level, usage, box);
37 void u_transfer_destroy_vtbl(struct pipe_context *pipe,
38 struct pipe_transfer *transfer)
40 struct u_resource *ur = u_resource(transfer->resource);
41 ur->vtbl->transfer_destroy(pipe, transfer);
44 void *u_transfer_map_vtbl( struct pipe_context *pipe,
45 struct pipe_transfer *transfer )
47 struct u_resource *ur = u_resource(transfer->resource);
48 return ur->vtbl->transfer_map(pipe, transfer);
51 void u_transfer_flush_region_vtbl( struct pipe_context *pipe,
52 struct pipe_transfer *transfer,
53 const struct pipe_box *box)
55 struct u_resource *ur = u_resource(transfer->resource);
56 ur->vtbl->transfer_flush_region(pipe, transfer, box);
59 void u_transfer_unmap_vtbl( struct pipe_context *pipe,
60 struct pipe_transfer *transfer )
62 struct u_resource *ur = u_resource(transfer->resource);
63 ur->vtbl->transfer_unmap(pipe, transfer);
66 void u_transfer_inline_write_vtbl( struct pipe_context *pipe,
67 struct pipe_resource *resource,
68 unsigned level,
69 unsigned usage,
70 const struct pipe_box *box,
71 const void *data,
72 unsigned stride,
73 unsigned layer_stride)
75 struct u_resource *ur = u_resource(resource);
76 ur->vtbl->transfer_inline_write(pipe,
77 resource,
78 level,
79 usage,
80 box,
81 data,
82 stride,
83 layer_stride);