summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_context.c
blob: 569fdd3f0f989cc7aa53d82482ddcddf15038491 (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* context) {
    struct r300_context* r300 = r300_context(context);

    draw_destroy(r300->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* r300 = CALLOC_STRUCT(r300_context);

    if (!r300)
        return NULL;

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

    r300->context.destroy = r300_destroy_context;

    return &r300->context;
}