diff options
author | Rob Clark <[email protected]> | 2013-10-25 15:33:09 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2013-10-29 16:49:43 -0400 |
commit | 2bc1fc2fb61897ab188f4a7150233827747827ff (patch) | |
tree | c7a66a18ae8c6042b47f4ef81f17b2b3e9a7dc6b /src/gallium/drivers/freedreno/freedreno_context.c | |
parent | b88191708816872a0bc93decec0507d797cd4018 (diff) |
freedreno: emulated unsupported primitive types
Use u_primconvert to convert unsupported primitives into supported
primitive plus index buffer.
Signed-off-by: Rob Clark <[email protected]>
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; |