[Mesa-dev] [PATCH 2/3] radeonsi: handle count_from_stream_output in a few IA_MULTI_VGT_PARAM cases

Marek Olšák maraeo at gmail.com
Mon Jan 30 00:33:56 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_state_draw.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 01340af..6b6613c 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -425,41 +425,43 @@ static unsigned si_get_ia_multi_vgt_param(struct si_context *sctx,
 		primgroup_size = 64; /* recommended with a GS */
 	} else {
 		primgroup_size = 128; /* recommended without a GS and tess */
 	}
 
 	key.u.prim = info->mode;
 	key.u.uses_instancing = info->indirect || info->instance_count > 1;
 	key.u.multi_instances_smaller_than_primgroup =
 		info->indirect ||
 		(info->instance_count > 1 &&
-		 si_num_prims_for_vertices(info) < primgroup_size);
+		 (info->count_from_stream_output ||
+		  si_num_prims_for_vertices(info) < primgroup_size));
 	key.u.primitive_restart = info->primitive_restart;
 	key.u.count_from_stream_output = info->count_from_stream_output != NULL;
 
 	ia_multi_vgt_param = sctx->ia_multi_vgt_param[key.index] |
 			     S_028AA8_PRIMGROUP_SIZE(primgroup_size - 1);
 
 	if (sctx->gs_shader.cso) {
 		/* GS requirement. */
 		if (SI_GS_PER_ES / primgroup_size >= sctx->screen->gs_table_depth - 3)
 			ia_multi_vgt_param |= S_028AA8_PARTIAL_ES_WAVE_ON(1);
 
 		/* GS hw bug with single-primitive instances and SWITCH_ON_EOI.
 		 * The hw doc says all multi-SE chips are affected, but Vulkan
 		 * only applies it to Hawaii. Do what Vulkan does.
 		 */
 		if (sctx->b.family == CHIP_HAWAII &&
 		    G_028AA8_SWITCH_ON_EOI(ia_multi_vgt_param) &&
 		    (info->indirect ||
 		     (info->instance_count > 1 &&
-		      si_num_prims_for_vertices(info) <= 1)))
+		      (info->count_from_stream_output ||
+		       si_num_prims_for_vertices(info) <= 1))))
 			sctx->b.flags |= SI_CONTEXT_VGT_FLUSH;
 	}
 
 	return ia_multi_vgt_param;
 }
 
 /* rast_prim is the primitive type after GS. */
 static void si_emit_rasterizer_prim_state(struct si_context *sctx)
 {
 	struct radeon_winsys_cs *cs = sctx->b.gfx.cs;
-- 
2.7.4



More information about the mesa-dev mailing list