1 #include "util/u_debug.h"
3 #include "brw_resource.h"
4 #include "brw_context.h"
5 #include "brw_screen.h"
8 static struct pipe_resource *
9 brw_resource_create(struct pipe_screen *screen,
10 const struct pipe_resource *template)
12 if (template->target == PIPE_BUFFER)
13 return brw_buffer_create(screen, template);
15 return brw_resource_create(screen, template);
19 static struct pipe_resource *
20 brw_resource_from_handle(struct pipe_screen * screen,
21 const struct pipe_resource *template,
22 struct winsys_handle *whandle)
24 if (template->target == PIPE_BUFFER)
27 return brw_texture_from_handle(screen, template, whandle);
32 brw_init_resource_functions(struct brw_context *brw )
34 brw->base.get_transfer = u_get_transfer_vtbl;
35 brw->base.transfer_map = u_transfer_map_vtbl;
36 brw->base.transfer_flush_region = u_transfer_flush_region_vtbl;
37 brw->base.transfer_unmap = u_transfer_unmap_vtbl;
38 brw->base.transfer_destroy = u_transfer_destroy_vtbl;
39 brw->base.transfer_inline_write = u_transfer_inline_write_vtbl;
43 brw_init_screen_resource_functions(struct brw_screen *is)
45 is->base.resource_create = brw_resource_create;
46 is->base.resource_from_handle = brw_resource_from_handle;
47 is->base.resource_get_handle = u_resource_get_handle_vtbl;
48 is->base.resource_destroy = u_resource_destroy_vtbl;
49 is->base.user_buffer_create = brw_user_buffer_create;