9ca4d180c05b6db80f5094f48e3103b305d942c4
5 /* Fallback implementations for inline read/writes which just go back
6 * to the regular transfer behaviour.
8 #include "pipe/p_state.h"
17 bool u_default_resource_get_handle(struct pipe_screen
*screen
,
18 struct pipe_resource
*resource
,
19 struct winsys_handle
*handle
);
21 void u_default_buffer_subdata(struct pipe_context
*pipe
,
22 struct pipe_resource
*resource
,
23 unsigned usage
, unsigned offset
,
24 unsigned size
, const void *data
);
26 void u_default_texture_subdata(struct pipe_context
*pipe
,
27 struct pipe_resource
*resource
,
30 const struct pipe_box
*box
,
33 unsigned layer_stride
);
35 void u_default_transfer_flush_region( struct pipe_context
*pipe
,
36 struct pipe_transfer
*transfer
,
37 const struct pipe_box
*box
);
39 void u_default_transfer_unmap( struct pipe_context
*pipe
,
40 struct pipe_transfer
*transfer
);
44 /* Useful helper to allow >1 implementation of resource functionality
45 * to exist in a single driver. This is intended to be transitionary!
47 struct u_resource_vtbl
{
49 bool (*resource_get_handle
)(struct pipe_screen
*,
50 struct pipe_resource
*tex
,
51 struct winsys_handle
*handle
);
53 void (*resource_destroy
)(struct pipe_screen
*,
54 struct pipe_resource
*pt
);
56 void *(*transfer_map
)(struct pipe_context
*,
57 struct pipe_resource
*resource
,
60 const struct pipe_box
*,
61 struct pipe_transfer
**);
64 void (*transfer_flush_region
)( struct pipe_context
*,
65 struct pipe_transfer
*transfer
,
66 const struct pipe_box
*);
68 void (*transfer_unmap
)( struct pipe_context
*,
69 struct pipe_transfer
*transfer
);
74 struct pipe_resource b
;
75 const struct u_resource_vtbl
*vtbl
;
79 bool u_resource_get_handle_vtbl(struct pipe_screen
*screen
,
80 struct pipe_context
*ctx
,
81 struct pipe_resource
*resource
,
82 struct winsys_handle
*handle
,
85 void u_resource_destroy_vtbl(struct pipe_screen
*screen
,
86 struct pipe_resource
*resource
);
88 void *u_transfer_map_vtbl(struct pipe_context
*context
,
89 struct pipe_resource
*resource
,
92 const struct pipe_box
*box
,
93 struct pipe_transfer
**transfer
);
95 void u_transfer_flush_region_vtbl( struct pipe_context
*pipe
,
96 struct pipe_transfer
*transfer
,
97 const struct pipe_box
*box
);
99 void u_transfer_unmap_vtbl( struct pipe_context
*rm_ctx
,
100 struct pipe_transfer
*transfer
);