st_device_really_destroy(struct st_device *st_dev)
{
if(st_dev->screen)
- st_dev->st_ws->screen_destroy(st_dev->screen);
+ st_dev->screen->destroy(st_dev->screen);
FREE(st_dev);
}
struct st_device *st_dev;
if(!st_ws->screen_create ||
- !st_ws->screen_destroy ||
- !st_ws->context_create ||
- !st_ws->context_destroy)
+ !st_ws->context_create)
return NULL;
st_dev = CALLOC_STRUCT(st_device);
}
if(st_ctx->pipe)
- st_ctx->st_dev->st_ws->context_destroy(st_ctx->pipe);
+ st_ctx->pipe->destroy(st_ctx->pipe);
for(i = 0; i < PIPE_MAX_SAMPLERS; ++i)
pipe_texture_reference(&st_ctx->sampler_textures[i], NULL);
void (*force_init_gallium_linkage)(void) = &init_gallium;
-static void
-st_hardpipe_screen_destroy(struct pipe_screen *screen)
-{
- st_softpipe_winsys.screen_destroy(screen);
-}
-
-
static struct pipe_screen *
st_hardpipe_screen_create(void)
{
}
-static void
-st_hardpipe_context_destroy(struct pipe_context *pipe)
-{
- st_softpipe_winsys.context_destroy(pipe);
-}
-
-
static struct pipe_context *
st_hardpipe_context_create(struct pipe_screen *screen)
{
const struct st_winsys st_hardpipe_winsys = {
&st_hardpipe_screen_create,
- &st_hardpipe_screen_destroy,
- &st_hardpipe_context_create,
- &st_hardpipe_context_destroy
+ &st_hardpipe_context_create
};
}
-static void
-st_softpipe_screen_destroy(struct pipe_screen *screen)
+static void
+st_softpipe_destroy(struct pipe_winsys *winsys)
{
- struct pipe_winsys *winsys = screen->winsys;
-
- screen->destroy(screen);
-
FREE(winsys);
}
if(!winsys)
return NULL;
+ winsys->destroy = st_softpipe_destroy;
+
winsys->buffer_create = st_softpipe_buffer_create;
winsys->user_buffer_create = st_softpipe_user_buffer_create;
winsys->buffer_map = st_softpipe_buffer_map;
screen = softpipe_create_screen(winsys);
if(!screen)
- FREE(winsys);
+ st_softpipe_destroy(winsys);
return screen;
}
-static void
-st_softpipe_context_destroy(struct pipe_context *pipe)
-{
- pipe->destroy(pipe);
-}
-
-
static struct pipe_context *
st_softpipe_context_create(struct pipe_screen *screen)
{
const struct st_winsys st_softpipe_winsys = {
&st_softpipe_screen_create,
- &st_softpipe_screen_destroy,
&st_softpipe_context_create,
- &st_softpipe_context_destroy
};
struct pipe_screen *
(*screen_create)(void);
- void
- (*screen_destroy)(struct pipe_screen *screen);
-
struct pipe_context *
(*context_create)(struct pipe_screen *screen);
-
- void
- (*context_destroy)(struct pipe_context *pipe);
};