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 struct pipe_transfer
* u_default_get_transfer(struct pipe_context
*context
,
31 struct pipe_resource
*resource
,
34 const struct pipe_box
*box
);
36 void u_default_transfer_unmap( struct pipe_context
*pipe
,
37 struct pipe_transfer
*transfer
);
39 void u_default_transfer_destroy(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 boolean (*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 struct pipe_transfer
*(*get_transfer
)(struct pipe_context
*,
57 struct pipe_resource
*resource
,
60 const struct pipe_box
*);
62 void (*transfer_destroy
)(struct pipe_context
*,
63 struct pipe_transfer
*);
65 void *(*transfer_map
)( struct pipe_context
*,
66 struct pipe_transfer
*transfer
);
68 void (*transfer_flush_region
)( struct pipe_context
*,
69 struct pipe_transfer
*transfer
,
70 const struct pipe_box
*);
72 void (*transfer_unmap
)( struct pipe_context
*,
73 struct pipe_transfer
*transfer
);
75 void (*transfer_inline_write
)( struct pipe_context
*pipe
,
76 struct pipe_resource
*resource
,
79 const struct pipe_box
*box
,
82 unsigned layer_stride
);
87 struct pipe_resource b
;
88 const struct u_resource_vtbl
*vtbl
;
92 boolean
u_resource_get_handle_vtbl(struct pipe_screen
*screen
,
93 struct pipe_resource
*resource
,
94 struct winsys_handle
*handle
);
96 void u_resource_destroy_vtbl(struct pipe_screen
*screen
,
97 struct pipe_resource
*resource
);
99 struct pipe_transfer
*u_get_transfer_vtbl(struct pipe_context
*context
,
100 struct pipe_resource
*resource
,
103 const struct pipe_box
*box
);
105 void u_transfer_destroy_vtbl(struct pipe_context
*pipe
,
106 struct pipe_transfer
*transfer
);
108 void *u_transfer_map_vtbl( struct pipe_context
*pipe
,
109 struct pipe_transfer
*transfer
);
111 void u_transfer_flush_region_vtbl( struct pipe_context
*pipe
,
112 struct pipe_transfer
*transfer
,
113 const struct pipe_box
*box
);
115 void u_transfer_unmap_vtbl( struct pipe_context
*rm_ctx
,
116 struct pipe_transfer
*transfer
);
118 void u_transfer_inline_write_vtbl( struct pipe_context
*rm_ctx
,
119 struct pipe_resource
*resource
,
122 const struct pipe_box
*box
,
125 unsigned layer_stride
);
127 void u_default_redefine_user_buffer(struct pipe_context
*ctx
,
128 struct pipe_resource
*resource
,