freedreno/a6xx: fix occlusion query with more than one tile
authorRob Clark <robdclark@chromium.org>
Tue, 18 Aug 2020 22:12:06 +0000 (15:12 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 Aug 2020 14:03:42 +0000 (14:03 +0000)
We need to emit epilogue after each tile, not just after the last tile.

Fixes: 13fc03f4c0e ("freedreno/a6xx: Avoid stalling for occlusion queries")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6376>

src/gallium/drivers/freedreno/a6xx/fd6_gmem.c

index a07e02c4af55a2160a79146df379ddcc242d4f3b..236151e01a7a8498ad8c7cefb0b7e4437cb8bc7d 100644 (file)
@@ -1226,6 +1226,9 @@ fd6_emit_tile(struct fd_batch *batch, const struct fd_tile *tile)
        } else {
                emit_conditional_ib(batch, tile, batch->draw);
        }
+
+       if (batch->epilogue)
+               fd6_emit_ib(batch->gmem, batch->epilogue);
 }
 
 static void
@@ -1267,9 +1270,6 @@ fd6_emit_tile_fini(struct fd_batch *batch)
 {
        struct fd_ringbuffer *ring = batch->gmem;
 
-       if (batch->epilogue)
-               fd6_emit_ib(batch->gmem, batch->epilogue);
-
        OUT_PKT4(ring, REG_A6XX_GRAS_LRZ_CNTL, 1);
        OUT_RING(ring, A6XX_GRAS_LRZ_CNTL_ENABLE);