lima: reset scissor state if scissor test is disabled
authorIcenowy Zheng <icenowy@aosc.io>
Mon, 16 Sep 2019 16:07:40 +0000 (00:07 +0800)
committerVasily Khoruzhick <anarsoul@gmail.com>
Tue, 17 Sep 2019 04:13:24 +0000 (04:13 +0000)
The PLBU seems to preserve scissor state between draws, and since lima doesn't
emit PLBU_CMD_SCISSORS() if scissor test is disabled, it uses state from previous draw.

Fix it by emitting PLBU_CMD_SCISSORS() for full fb if scissor test is disabled.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
src/gallium/drivers/lima/lima_draw.c

index 3b8f7526f3216889189fd87ba49023e6b0c7540c..4fdc10d5ff25873dfffcc2bc5c913edf9db3bb68 100644 (file)
@@ -848,6 +848,8 @@ lima_pack_vs_cmd(struct lima_context *ctx, const struct pipe_draw_info *info)
 static void
 lima_pack_plbu_cmd(struct lima_context *ctx, const struct pipe_draw_info *info)
 {
+   struct lima_context_framebuffer *fb = &ctx->framebuffer;
+
    lima_pack_head_plbu_cmd(ctx);
 
    /* If it's zero scissor, we skip adding all other commands */
@@ -890,6 +892,8 @@ lima_pack_plbu_cmd(struct lima_context *ctx, const struct pipe_draw_info *info)
    if (ctx->rasterizer->base.scissor) {
       struct pipe_scissor_state *scissor = &ctx->scissor;
       PLBU_CMD_SCISSORS(scissor->minx, scissor->maxx, scissor->miny, scissor->maxy);
+   } else {
+      PLBU_CMD_SCISSORS(0, fb->base.width, 0, fb->base.height);
    }
 
    PLBU_CMD_UNKNOWN1();