From cba475b3e76f3dec31e0cacbee90a85c6edb784b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 9 Nov 2018 22:27:05 -0500 Subject: [PATCH] radeonsi: use u_decomposed_prims_for_vertices instead of u_prims_for_vertices MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It seems to be the same, but this doesn't use integer division with a variable divisor. Tested-by: Dieter Nützel --- src/gallium/drivers/radeonsi/si_state_draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 6454491457b..d0b2e18b4ea 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -315,10 +315,12 @@ static unsigned si_num_prims_for_vertices(const struct pipe_draw_info *info) switch (info->mode) { case PIPE_PRIM_PATCHES: return info->count / info->vertices_per_patch; + case PIPE_PRIM_POLYGON: + return info->count >= 3; case SI_PRIM_RECTANGLE_LIST: return info->count / 3; default: - return u_prims_for_vertices(info->mode, info->count); + return u_decomposed_prims_for_vertices(info->mode, info->count); } } -- 2.30.2