radeonsi: use optimal WD settings for primitive restart on Polaris
authorMarek Olšák <marek.olsak@amd.com>
Fri, 8 Apr 2016 10:57:43 +0000 (12:57 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 27 Jun 2016 11:54:39 +0000 (13:54 +0200)
ported from Vulkan

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index 717149bceb181c52ddcd14b7f9f62eab4f5a42bb..5f866d5bd21ee2016ef6a2be80bfea83043466ba 100644 (file)
@@ -291,13 +291,21 @@ static unsigned si_get_ia_multi_vgt_param(struct si_context *sctx,
        if (sctx->b.chip_class >= CIK) {
                /* WD_SWITCH_ON_EOP has no effect on GPUs with less than
                 * 4 shader engines. Set 1 to pass the assertion below.
-                * The other cases are hardware requirements. */
+                * The other cases are hardware requirements.
+                *
+                * Polaris supports primitive restart with WD_SWITCH_ON_EOP=0
+                * for points, line strips, and tri strips.
+                */
                if (sctx->b.screen->info.max_se < 4 ||
                    prim == PIPE_PRIM_POLYGON ||
                    prim == PIPE_PRIM_LINE_LOOP ||
                    prim == PIPE_PRIM_TRIANGLE_FAN ||
                    prim == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY ||
-                   info->primitive_restart ||
+                   (info->primitive_restart &&
+                    (sctx->b.family < CHIP_POLARIS10 ||
+                     (prim != PIPE_PRIM_POINTS &&
+                      prim != PIPE_PRIM_LINE_STRIP &&
+                      prim != PIPE_PRIM_TRIANGLE_STRIP))) ||
                    info->count_from_stream_output)
                        wd_switch_on_eop = true;