diff options
author | Rob Clark <[email protected]> | 2013-06-01 14:16:30 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2013-06-08 13:15:51 -0400 |
commit | e9edbf0a688c68ef0896e5d4278f411f6b6f8398 (patch) | |
tree | bd6ce7e7ae737c5fdefac62aa3c10b3be3029125 /src/gallium/drivers/freedreno/freedreno_context.h | |
parent | 4af1dcbb7d5431ae75cc39568c99d7a20231f081 (diff) |
freedreno: better scissor fix
Actually respect rasterizer state.
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 54759314e26..3d18260445f 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -139,6 +139,12 @@ struct fd_context { struct pipe_scissor_state scissor; + /* we don't have a disable/enable bit for scissor, so instead we keep + * a disabled-scissor state which matches the entire bound framebuffer + * and use that when scissor is not enabled. + */ + struct pipe_scissor_state disabled_scissor; + /* Track the maximal bounds of the scissor of all the draws within a * batch. Used at the tile rendering step (fd_gmem_render_tiles(), * mem2gmem/gmem2mem) to avoid needlessly moving data in/out of gmem. @@ -218,6 +224,14 @@ fd_context(struct pipe_context *pctx) return (struct fd_context *)pctx; } +static INLINE struct pipe_scissor_state * +fd_context_get_scissor(struct fd_context *ctx) +{ + if (ctx->rasterizer && ctx->rasterizer->scissor) + return &ctx->scissor; + return &ctx->disabled_scissor; +} + struct pipe_context * fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen, void *priv); |