r300screen->screen.resource_from_handle = r300_texture_from_handle;
r300screen->screen.resource_get_handle = r300_resource_get_handle;
r300screen->screen.resource_destroy = u_resource_destroy_vtbl;
- r300screen->screen.user_buffer_create = r300_user_buffer_create;
}
return &rbuf->b.b;
}
-
-struct pipe_resource *r300_user_buffer_create(struct pipe_screen *screen,
- void *ptr, unsigned size,
- unsigned bind)
-{
- struct r300_screen *r300screen = r300_screen(screen);
- struct r300_resource *rbuf;
-
- rbuf = util_slab_alloc(&r300screen->pool_buffers);
-
- pipe_reference_init(&rbuf->b.b.reference, 1);
- rbuf->b.b.screen = screen;
- rbuf->b.b.target = PIPE_BUFFER;
- rbuf->b.b.format = PIPE_FORMAT_R8_UNORM;
- rbuf->b.b.usage = PIPE_USAGE_IMMUTABLE;
- rbuf->b.b.bind = bind;
- rbuf->b.b.width0 = ~0;
- rbuf->b.b.height0 = 1;
- rbuf->b.b.depth0 = 1;
- rbuf->b.b.array_size = 1;
- rbuf->b.b.flags = 0;
- rbuf->b.vtbl = &r300_buffer_vtbl;
- rbuf->domain = RADEON_DOMAIN_GTT;
- rbuf->buf = NULL;
- rbuf->constant_buffer = NULL;
- return &rbuf->b.b;
-}
struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
const struct pipe_resource *templ);
-struct pipe_resource *r300_user_buffer_create(struct pipe_screen *screen,
- void *ptr, unsigned size,
- unsigned bind);
-
/* Inline functions. */
static INLINE struct r300_buffer *r300_buffer(struct pipe_resource *buffer)