Mesa (master): radeonsi: fix si_num_prims_for_vertices for PIPE_PRIM_POLYGON

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 18 01:33:14 UTC 2021


Module: Mesa
Branch: master
Commit: c43d00dc915e9f43cd87d752bef1f8dc9ec25e34
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c43d00dc915e9f43cd87d752bef1f8dc9ec25e34

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Dec 26 22:13:13 2020 -0500

radeonsi: fix si_num_prims_for_vertices for PIPE_PRIM_POLYGON

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8548>

---

 src/gallium/drivers/radeonsi/si_state_draw.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index 26598a1ddf4..7f9bdc63ac7 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -341,7 +341,8 @@ static unsigned si_num_prims_for_vertices(enum pipe_prim_type prim,
    case PIPE_PRIM_PATCHES:
       return count / vertices_per_patch;
    case PIPE_PRIM_POLYGON:
-      return count >= 3;
+      /* It's a triangle fan with different edge flags. */
+      return count >= 3 ? count - 2 : 0;
    case SI_PRIM_RECTANGLE_LIST:
       return count / 3;
    default:



More information about the mesa-commit mailing list