1 #include "util/u_debug.h"
3 #include "svga_resource.h"
4 #include "svga_resource_buffer.h"
5 #include "svga_resource_texture.h"
6 #include "svga_context.h"
7 #include "svga_screen.h"
10 static struct pipe_resource *
11 svga_resource_create(struct pipe_screen *screen,
12 const struct pipe_resource *template)
14 if (template->target == PIPE_BUFFER)
15 return svga_buffer_create(screen, template);
17 return svga_resource_create(screen, template);
21 static struct pipe_resource *
22 svga_resource_from_handle(struct pipe_screen * screen,
23 const struct pipe_resource *template,
24 struct winsys_handle *whandle)
26 if (template->target == PIPE_BUFFER)
29 return svga_resource_from_handle(screen, template, whandle);
34 svga_init_resource_functions(struct svga_context *svga)
36 svga->pipe.get_transfer = u_get_transfer_vtbl;
37 svga->pipe.transfer_map = u_transfer_map_vtbl;
38 svga->pipe.transfer_flush_region = u_transfer_flush_region_vtbl;
39 svga->pipe.transfer_unmap = u_transfer_unmap_vtbl;
40 svga->pipe.transfer_destroy = u_transfer_destroy_vtbl;
41 svga->pipe.transfer_inline_write = u_transfer_inline_write_vtbl;
45 svga_init_screen_resource_functions(struct svga_screen *is)
47 is->screen.resource_create = svga_resource_create;
48 is->screen.resource_from_handle = svga_resource_from_handle;
49 is->screen.resource_get_handle = u_resource_get_handle_vtbl;
50 is->screen.resource_destroy = u_resource_destroy_vtbl;
51 is->screen.user_buffer_create = svga_user_buffer_create;