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.h | |
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.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_context.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 808e3a72f02..d3a01fcb84b 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -31,6 +31,7 @@ #include "draw/draw_context.h" #include "pipe/p_context.h" +#include "indices/u_primconvert.h" #include "util/u_blitter.h" #include "util/u_slab.h" #include "util/u_string.h" @@ -93,9 +94,17 @@ struct fd_context { struct fd_screen *screen; struct blitter_context *blitter; + struct primconvert_context *primconvert; struct util_slab_mempool transfer_pool; + /* table with PIPE_PRIM_MAX entries mapping PIPE_PRIM_x to + * DI_PT_x value to use for draw initiator. There are some + * slight differences between generation: + */ + const uint8_t *primtypes; + uint32_t primtype_mask; + /* shaders used by clear, and gmem->mem blits: */ struct fd_program_stateobj solid_prog; // TODO move to screen? @@ -244,8 +253,15 @@ fd_context_get_scissor(struct fd_context *ctx) return &ctx->disabled_scissor; } +static INLINE bool +fd_supported_prim(struct fd_context *ctx, unsigned prim) +{ + return (1 << prim) & ctx->primtype_mask; +} + struct pipe_context * fd_context_init(struct fd_context *ctx, - struct pipe_screen *pscreen, void *priv); + struct pipe_screen *pscreen, const uint8_t *primtypes, + void *priv); void fd_context_render(struct pipe_context *pctx); |