freedreno: mark scissor state dirty when enable bit changes
authorRob Clark <robclark@freedesktop.org>
Tue, 21 Oct 2014 15:28:53 +0000 (11:28 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 22 Oct 2014 00:08:49 +0000 (20:08 -0400)
We don't have a scissor enable bit in hw, so when a raster state change
results in scissor enable bit changing, we need to also mark scissor
state as dirty.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_state.c

index 27869295622c6693307de94a3c923abcbe4017f5..6293f439125a876ce3d8db496d519afebaef8b03 100644 (file)
@@ -237,8 +237,18 @@ static void
 fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso)
 {
        struct fd_context *ctx = fd_context(pctx);
+       struct pipe_scissor_state *old_scissor = fd_context_get_scissor(ctx);
+
        ctx->rasterizer = hwcso;
        ctx->dirty |= FD_DIRTY_RASTERIZER;
+
+       /* if scissor enable bit changed we need to mark scissor
+        * state as dirty as well:
+        * NOTE: we can do a shallow compare, since we only care
+        * if it changed to/from &ctx->disable_scissor
+        */
+       if (old_scissor != fd_context_get_scissor(ctx))
+               ctx->dirty |= FD_DIRTY_SCISSOR;
 }
 
 static void