diff options
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_context.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index 96e1ef6e579..ddb8a0b78fb 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -123,6 +123,9 @@ fd_context_destroy(struct pipe_context *pctx) if (ctx->blitter) util_blitter_destroy(ctx->blitter); + if (ctx->primconvert) + util_primconvert_destroy(ctx->primconvert); + fd_ringmarker_del(ctx->draw_start); fd_ringmarker_del(ctx->draw_end); fd_ringbuffer_del(ctx->ring); @@ -131,8 +134,8 @@ fd_context_destroy(struct pipe_context *pctx) } struct pipe_context * -fd_context_init(struct fd_context *ctx, - struct pipe_screen *pscreen, void *priv) +fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen, + const uint8_t *primtypes, void *priv) { struct fd_screen *screen = fd_screen(pscreen); struct pipe_context *pctx; @@ -140,6 +143,12 @@ fd_context_init(struct fd_context *ctx, ctx->screen = screen; + ctx->primtypes = primtypes; + ctx->primtype_mask = 0; + for (i = 0; i < PIPE_PRIM_MAX; i++) + if (primtypes[i]) + ctx->primtype_mask |= (1 << i); + /* need some sane default in case state tracker doesn't * set some state: */ @@ -170,6 +179,9 @@ fd_context_init(struct fd_context *ctx, if (!ctx->blitter) goto fail; + ctx->primconvert = util_primconvert_create(pctx, ctx->primtype_mask); + if (!ctx->primconvert) + goto fail; return pctx; |