summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_context.c
blob: a2ed0270cbef167a636a32b1c32a1fc330bd4dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "r300_context.h"

static void r300_destroy_context(struct pipe_context* pipe) {
    struct r300_context* context = r300_context(pipe);

    draw_destroy(context->draw);

    FREE(context);
}

struct pipe_context* r300_create_context(struct pipe_screen* screen,
                                         struct pipe_winsys* winsys,
                                         struct amd_winsys* amd_winsys)
{
    struct r300_context* context = CALLOC_STRUCT(r300_context);

    if (!context)
        return NULL;

    context->winsys = amd_winsys;
    context->pipe.winsys = winsys;
    context->pipe.screen = screen;

    context->pipe.destroy = r300_destroy_context;

    return &context->pipe;
}