5 /* Fallback implementations for inline read/writes which just go back
6 * to the regular transfer behaviour.
8 #include "pipe/p_state.h"
13 boolean
u_default_resource_get_handle(struct pipe_screen
*screen
,
14 struct pipe_resource
*resource
,
15 struct winsys_handle
*handle
);
17 void u_default_buffer_subdata(struct pipe_context
*pipe
,
18 struct pipe_resource
*resource
,
19 unsigned usage
, unsigned offset
,
20 unsigned size
, const void *data
);
22 void u_default_texture_subdata(struct pipe_context
*pipe
,
23 struct pipe_resource
*resource
,
26 const struct pipe_box
*box
,
29 unsigned layer_stride
);
31 void u_default_transfer_flush_region( struct pipe_context
*pipe
,
32 struct pipe_transfer
*transfer
,
33 const struct pipe_box
*box
);
35 void u_default_transfer_unmap( struct pipe_context
*pipe
,
36 struct pipe_transfer
*transfer
);
40 /* Useful helper to allow >1 implementation of resource functionality
41 * to exist in a single driver. This is intended to be transitionary!
43 struct u_resource_vtbl
{
45 boolean (*resource_get_handle
)(struct pipe_screen
*,
46 struct pipe_resource
*tex
,
47 struct winsys_handle
*handle
);
49 void (*resource_destroy
)(struct pipe_screen
*,
50 struct pipe_resource
*pt
);
52 void *(*transfer_map
)(struct pipe_context
*,
53 struct pipe_resource
*resource
,
56 const struct pipe_box
*,
57 struct pipe_transfer
**);
60 void (*transfer_flush_region
)( struct pipe_context
*,
61 struct pipe_transfer
*transfer
,
62 const struct pipe_box
*);
64 void (*transfer_unmap
)( struct pipe_context
*,
65 struct pipe_transfer
*transfer
);
70 struct pipe_resource b
;
71 const struct u_resource_vtbl
*vtbl
;
75 boolean
u_resource_get_handle_vtbl(struct pipe_screen
*screen
,
76 struct pipe_context
*ctx
,
77 struct pipe_resource
*resource
,
78 struct winsys_handle
*handle
,
81 void u_resource_destroy_vtbl(struct pipe_screen
*screen
,
82 struct pipe_resource
*resource
);
84 void *u_transfer_map_vtbl(struct pipe_context
*context
,
85 struct pipe_resource
*resource
,
88 const struct pipe_box
*box
,
89 struct pipe_transfer
**transfer
);
91 void u_transfer_flush_region_vtbl( struct pipe_context
*pipe
,
92 struct pipe_transfer
*transfer
,
93 const struct pipe_box
*box
);
95 void u_transfer_unmap_vtbl( struct pipe_context
*rm_ctx
,
96 struct pipe_transfer
*transfer
);