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_transfer_inline_write( struct pipe_context
*pipe
,
18 struct pipe_resource
*resource
,
21 const struct pipe_box
*box
,
24 unsigned layer_stride
);
26 void u_default_transfer_flush_region( struct pipe_context
*pipe
,
27 struct pipe_transfer
*transfer
,
28 const struct pipe_box
*box
);
30 void u_default_transfer_unmap( struct pipe_context
*pipe
,
31 struct pipe_transfer
*transfer
);
35 /* Useful helper to allow >1 implementation of resource functionality
36 * to exist in a single driver. This is intended to be transitionary!
38 struct u_resource_vtbl
{
40 boolean (*resource_get_handle
)(struct pipe_screen
*,
41 struct pipe_resource
*tex
,
42 struct winsys_handle
*handle
);
44 void (*resource_destroy
)(struct pipe_screen
*,
45 struct pipe_resource
*pt
);
47 void *(*transfer_map
)(struct pipe_context
*,
48 struct pipe_resource
*resource
,
51 const struct pipe_box
*,
52 struct pipe_transfer
**);
55 void (*transfer_flush_region
)( struct pipe_context
*,
56 struct pipe_transfer
*transfer
,
57 const struct pipe_box
*);
59 void (*transfer_unmap
)( struct pipe_context
*,
60 struct pipe_transfer
*transfer
);
62 void (*transfer_inline_write
)( struct pipe_context
*pipe
,
63 struct pipe_resource
*resource
,
66 const struct pipe_box
*box
,
69 unsigned layer_stride
);
74 struct pipe_resource b
;
75 const struct u_resource_vtbl
*vtbl
;
79 boolean
u_resource_get_handle_vtbl(struct pipe_screen
*screen
,
80 struct pipe_resource
*resource
,
81 struct winsys_handle
*handle
);
83 void u_resource_destroy_vtbl(struct pipe_screen
*screen
,
84 struct pipe_resource
*resource
);
86 void *u_transfer_map_vtbl(struct pipe_context
*context
,
87 struct pipe_resource
*resource
,
90 const struct pipe_box
*box
,
91 struct pipe_transfer
**transfer
);
93 void u_transfer_flush_region_vtbl( struct pipe_context
*pipe
,
94 struct pipe_transfer
*transfer
,
95 const struct pipe_box
*box
);
97 void u_transfer_unmap_vtbl( struct pipe_context
*rm_ctx
,
98 struct pipe_transfer
*transfer
);
100 void u_transfer_inline_write_vtbl( struct pipe_context
*rm_ctx
,
101 struct pipe_resource
*resource
,
104 const struct pipe_box
*box
,
107 unsigned layer_stride
);