660dc161d33b01ed65ee91955fef4f8111959760
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
,
84 void u_resource_destroy_vtbl(struct pipe_screen
*screen
,
85 struct pipe_resource
*resource
);
87 void *u_transfer_map_vtbl(struct pipe_context
*context
,
88 struct pipe_resource
*resource
,
91 const struct pipe_box
*box
,
92 struct pipe_transfer
**transfer
);
94 void u_transfer_flush_region_vtbl( struct pipe_context
*pipe
,
95 struct pipe_transfer
*transfer
,
96 const struct pipe_box
*box
);
98 void u_transfer_unmap_vtbl( struct pipe_context
*rm_ctx
,
99 struct pipe_transfer
*transfer
);
101 void u_transfer_inline_write_vtbl( struct pipe_context
*rm_ctx
,
102 struct pipe_resource
*resource
,
105 const struct pipe_box
*box
,
108 unsigned layer_stride
);